使用SQL语句导出Excel

EXEC master..xp_cmdshell 'bcp siasnews.dbo.testuser out "c:\test.xls" -c -S"datacenter01" -U"用户名" -P"密码"'

原文地址:https://www.cnblogs.com/byxzbg/p/3110393.html