--sql server中开启xp_cmdshell命令 1. --允许配置高级选项 GO RECONFIGURE GO . --开启xp_cmdshell服务 RECONFIGURE GO . --使用 xp_cmdshell master..xp_cmdshell 'copy e:\databasebackup\test.bak m:' . -- 允许配置高级选项 GO RECONFIGURE GO -- 禁用xp_cmdshell GO RECONFIGURE GO
exec master..xp_cmdshell 'bcp "select c.Category_Title as 标题,p.Category_Title as 所属分类 from ltblGameStore..tbl_Category as c left join ltblGameStore..tbl_Category as p on c.Category_ParentId = p.Category_Id" queryout D:\test\Temp.xls -c -q -S&quo