SQL导出excel

我在SQL 2008R2 里面用下面的命令成功导出excel 文件。

EXEC master..xp_cmdshell 'bcp "select * from Car_data.dbo.CarInfo"  queryout d: mp.xls -c -q -S"." -U"sa" -P"123456" '

原文地址:https://www.cnblogs.com/yangdunqin/p/sqlexcel.html