May 16, 2011 at 11:30 pm
Hi guys,
I have a DTS that imports data from a csv text file to an SQL table.
The problem is that the column names is not located in the first row. There are a bunch of text in the upper part of the file.
Is there a way for to get the column names for mapping? I've tried "Skip Rows" and checked the "First row has column names" but it always retrieves the text in the first line of the file.
Thanks very much.
May 18, 2011 at 1:42 pm
What do you mean there is a bunch of text in the upper part of the file?
How is the csv being created? The csv needs to be created or saved with the columns Names in the first row.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
May 18, 2011 at 6:54 pm
There are miscellaneous information in the first 10 lines like the date the file was created, the title of the report, etc.
The column headers starts in line 11.
May 18, 2011 at 7:24 pm
richarddelcarmen (5/18/2011)
There are miscellaneous information in the first 10 lines like the date the file was created, the title of the report, etc.The column headers starts in line 11.
How is the file being created and by whom?
Sounds like a report.
You probably just need to talk to the people that generating the file and ask that they modify the file format.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
May 18, 2011 at 7:31 pm
Yeah, that's what we did since it will be more efficient in terms of performance and data integrity of the import process.
Just curious if it is natively possible in DTS.
It is however possible in SSIS using the "Column Headers to Skip" property of the Flat File Connection Manager.
Thanks Welsh.
May 19, 2011 at 9:02 am
You can skip but if you can get the file with the column names and without a header.
In my opinion it makes it easier if you have the column names in the flat file when you are trying to troubleshoot a problem.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply