BCP code to extract a large amount of data from MS SQL Server
There are plenty of examples on the internet - search for "bcp comma delimited"  Also, refer to the BCP syntax here.

This should get you started:

bcp &lt;YourDatabase&gt;.&lt;YourSchema&gt;.&lt;YourTable&gt; out C:\OutData.dat -o C:\OutData.log -S . -T -c -a 65535' -t, -b100000



BCP - the command
the fully qualified object you're exporting from Sql Server (this could also be a view)
out - the path and file name of the exported data
-o - the output log information about number of rows extracted
-S - the sql server instance name (default here)
-T - use a trusted connection
-c - export the data in character format
-a - packet size of 65535
-t - your column delimiter (comma in this case)
-b - batch size (for performance)