Bulk copy export in SQL using queryout

sql sqlbulkcopy sql-server-2008

Question

I am testing a simple syntax for Bulk Copy export - Output file is a Flat File with tab delimiter (either in SQL Server 2008 or 2012).

Somehow my command is throwing a syntax error on queryout:

bcp "SELECT * FROM DatabaseLog" queryout "C:\Test\TestingBulkCopy.txt" -t\t -c -T
1
0
1/21/2018 5:53:48 PM

Popular Answer

BCP is a command-line utility. You need to run it for an OS command prompt rather than from a T-SQL session.

0
1/21/2018 6:01:01 PM


Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow