SQL 直接汇出 Excel 表

exec   master..xp_cmdshell   'bcp   "select *  from   [BookShop].[dbo].[tb_Books]  where [UnitPrice]=22"   queryout   d:temp.xls   -c   -q   -S"."   -U"sa"   -P""'
原文地址:https://www.cnblogs.com/hishanghai/p/2535477.html