28,406
社区成员
发帖
与我相关
我的任务
分享 SET NOCOUNT ON;
EXEC master.dbo.sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC master.dbo.sp_configure 'xp_cmdshell', 1;
RECONFIGURE;
EXECUTE('EXEC master..xp_cmdshell ''bcp "SELECT * FROM [db]..[tal]" queryout "' + @Filename + '.xls" -c -T''');
EXEC master.dbo.sp_configure 'xp_cmdshell', 0;
RECONFIGURE;