SQL SERVER利用BCP命令在命令行下导出数据到csv文件中

bcp "select  * from (DBNAME).dbo.qt_trace where User_1 is not null" queryout c:\%date:~6,4%%date:~0,2%%date:~3,2%%time:~0,2%%time:~3,2%%time:~6,2%.csv -S"KUNWSQL1\TEST" -Uusr1 -Ppwd1 -c -t"," -r"\n"



pause

 

你可能感兴趣的:(SQL Server)