How can I export data to csv format in SQL Server 2005?
The easiest way to do this would be to use the
SQLCMD -S MyInstance -E -d sales -i query_file.sql -o output_file.csv -s ,
Look at the hyperlink listed above for more SQLCMD options that can make automating many of your everyday tasks simple.