Ta-Dah! The  switches below in the BCP statement export the results of the query to CSV

BCP "select * from table" QUERYOUT "C:\TEST.csv" -c -t"," -r"\n" -T -S server

:-)

 

 

 

Yes you could probably use the import/output wizard  that comes with MS SQL but if all you want to do is import a simple CSV file quickly into T-SQL, why not just use an easy bit of T-SQL.

USE <<DATABASE_NAME>>
BULK
INSERT <<TABLE_NAME>>
FROM 'FULL_FILE_PATH.csv'
WITH ( FIELDTERMINATOR= ',' , ROWTERMINATOR= '\n' )

This simple script could be modified to suit importing  data with a variety of field and row terminators.