PDA

View Full Version : How do I spool a .csv file using SQL?


rio27713
10-11-2007, 08:15 PM
I'm trying to Spool a .csv file using SQL, but when a comma is in the data, it is treated like a new column. Is there a way to ouput to a .csv file, but not use the commas as a new column?

Icon
10-11-2007, 08:17 PM
csv stands for a comma separated file ... having a comma separate columns is the point.

If you want to delimited against another character you can set up DTS to not use a comma to delimit or you can even make your SQL select have the delimitation in it. My guess is that you have some text field with a comma in it and that is making the columns not line up correctly. You might also wanna try making your text frields "quoatable" which ironically means that DTS puts quotes around it and that way when you make the csv you shouldn't have it split the middle of your field.