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

 

posted @ 2014-03-21 13:25  自由的企鹅  阅读(1829)  评论(0编辑  收藏  举报