SQLTeam.com | Weblogs | Forums

Sqlcmd export to csv doesnt export correctly with tables over a certain amount of colums


#1

while using sqlcmd with a table of over 300 columns to .csv file (yes crazy i didnt design it) when the data is copied over after a certain column my data is showing incorrect values in the .csv file, so if my factor_ 1 should be .23 it says NULL and so on. how do i avoid this and ensure all my data is coming over under their allotted column headings. i did a select from the source table factor_1 is showing as .23 NOT NULL . i tried using bcp same issue

sqlcmd -S TESTSERVER - E -i c:\test.sql -o c:files\test.csv -s "," -W -d DATABASENAME

why does sqlcmd do this.
within my .sql file i am doing a select listing all columns from table