SSIS Excel Source Dynamic column name and column size - ssis

I have excel files. None of these column names and column numbers are equal. I want the folder to receive that data as the file is uploaded unconditionally. How can I do it .

Solved.
If you experience such a problem, check the link below
https://dwbi1.wordpress.com/2011/03/05/ssis-importing-a-file-with-dynamic-columns/

Related

Source File Connection (Flat File) - Not reading column metadata

When I create the SSIS package it requires a file to be referenced to pick up the files metadata. For example the column headers will be ColumnA, ColumnB.
I have always assumed that these column names need to be present in the file for it to be loaded. Recently business, for whatever reason, changed one of the column names in the file to something else so the file contains ColumnA, NotColumnB. When the SSIS package runs it ignores this and loads the file. I assumed that it would fail. Is my assumption correct and there is something weird going on or is my assumption incorrect, if so please let me know why.
I have changed the column names in a few other packages that load data from a file and they also dont care what the column names are
Click on the flat file source, and press F4 to show the properties tab. There are a property called ValidateExternalMetadata change it to True.
For more information check the following answer:
Detect new column in source not mapped to destination and fail in SSIS
Update 1
It looks like that flat file connection manager has no validation engine and the metadata defined is used at configuration time to configure the mappings between the data file and the database.
Why Does't SSIS Flat File Data Check If Columns Names or Order Have Changed? What is best way to check?
Flat file destination columns data types validation

How to Write the File and File Path to table

I have a SSIS package - which within a FOR LOOP CONTAINER I look in a particular location, for a particular file format and import it into a database.
This is working fine - when I have two files the contents of both files are being imported.
So I have a Variable Mapping under my ForLoop which records the fully qualified name. What I want to do is when I import the file is I am also recording the file path of where it has come from.
I'm unsure in my dataflow task where I would put that ? Under the data flow I have my source file and a destination.
I tried to have a sql task after the data flow that updated the field in the database with the variable (via Parameter Mapping), but that set the field to the same value for everything (the last file path found) which is not what I'm after.
Any advice would be welcome
In your dataflow task, in between your source and destination add a Derived Column transformation. This will add columns to your dataset with a name and value that you specify. If you reference variables in which you are storing the file name for your loop container, the name of the file being accessed will be appended to an additional column in your dataset. Obviously you need to make sure that this column is present in your destination table.

mapping automatically columns into a destination flat file in SSIS

I need to export a table having more than 100 colonnes to a destination flat file, how can I map them automatically and not one by one one manually in SSIS SQL2012. There is any option as the automatic mapping existing in DTS?
Assuming the flat file already exists, then it's a simple matter of going into your flat file destination and there should be an option, might be right click, for auto map by column name.
Unless your text file has column names specified in it, it will be named column1 to column100. This will not automatically map to your destination (Unless destination is column1 to column100). You will have to put in the effort and rename the 'column1' names of the text source to your destination's column names.

Getting excel filename in ssis

I was wondering if anyone could help me with getting the excel (source) filename on my destination database in ssis. The database table has a column called filename (which is equal to the excel filename). Having the filename will help me with my audits. Note: I'm not a vb script person but if vb is the only way out, I'll appreciate sample script as I would have to use that in my logic. Thanks
You can use a "Derived Column" component and add a new column that contains the wanted property. I guess that you want to add a derived column that will store the "FileName" or "ConnectionString" property of your Excel Connection.
I would recommend saving the file as a CSV for multiple reasons. If it is a CSV file, you could create a flat file source for it. Then right click on the item and go to "Show Advanced Editor..." Click on the "Component Properties" tab and go to "Custom Properties" at the bottom. There is a field caled "FileNameColumnName." For the value, put the name of what column you want to store the file name in. Then, the that field will be available for your destination.
http://sqlblog.com/blogs/jamie_thomson/archive/2010/03/31/filenamecolumnname-property-flat-file-source-adapter-ssis-nugget.aspx

2 csv file export to excel file using ssis

I'm trying read the data from 2 csv files and export into the new excel file, but I'm not able to export the data in excel destination. While doing the mapping of the columns, there are 4 columns in the input columns but it is showing only 1 column in available output column that is only F1. Please let me know how to resolve this issue.
If I understand the question correctly, you are unable to map columns to a ‘new’ XL file.
If this is the case, the metadata for the mappings is probably the issue.
Try first creating a new xl file with the column headings and column types you want, then map to this.
Alternativly, right click on the excel destination and use the ‘Show Advanced Editor’ option and then adjust the columns in the ‘External Colums’ of ‘Input and Output settings tab.
You may then need to set the ValidateExternalMetadata option to false for the excel destination component in order to allow creation of new files from scratch.
Open an excel sheet and on the 1st row, give the column headings. Column A, B, C and D should have the same names as your source columns. After doing so, save the excel file and close the work book. Go to SSIS and open the Excel destination mappings. You should be able to map them now.