首页 > 代码库 > BCP导出数据到EXCEL

BCP导出数据到EXCEL

SET @FilePath=D:\TEST.xls
SET @sql=bcp "SELECT * FROM XXX.dbo.XXX WITH(NOLOCK) WHERE XXX=‘‘XXX‘‘ AND XXX = +@XXX+" QueryOut +@FilePath+ -c -T 
EXEC master..xp_cmdshell @SQL 

 

BCP导出数据到EXCEL