CSV file to SQL Server
Hi, I m trying to import data into SQL Server from a CSV file. It has been working fine since last week. Now the data format has been changed in one of the columns. Basically we are using comma separtor for column delimiters. One of the columns in CSV file has data like company,inc. i.e.,One of the columns has comma separated values, but it belongs to a single column. But when I export to sql server, It is generating 2 columns. Can someone suggest me a way to get around this? Can I try any other column delimiters? please advise... Thank you
May 14th, 2012 8:50pm

If I understand the scenario correctly, your CSV file has data containing the column delimiter. For example: John, Doe, Microsoft Corp., Redmond,WA But you want Redmond,WA to be treated as a single column. To solve this problem, you will need to use text qualifiers - basically surround the text with single or double quotes so that it is treated as a single value. Using the example above, the data would be: "John", "Doe", "Microsoft Corp.", "Redmond,WA" Farooq Mahmud | Support Escalation Engineer | Microsoft Health Solutions Group
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2012 9:05pm

Thanks for your quick reply. Do you mean in the csv file should I put those qualifiers? But we get these csv files every 2 days. We may have this data every time. It is very hard every time to open the csv file and update it with text qualifiers. Is there any other method to solve this? Thank you
May 14th, 2012 9:43pm

Suggest the team whoever sending csv files to you to give text qualifier in case of this "Redmond,WA" and use that text qualifier in your flat file source task .In case you are not able to suggest it.You need to use script task to parse the csv file.Bharath T
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2012 1:50am

Text qualifier fixed the issue. Thank you very much for the help.
May 15th, 2012 2:35pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics