EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;
exec master..xp_cmdshell 'bcp "SELECT * FROM emergency.dbo.log" queryout c:\bb.xls -c -S"wzp" -U"sa" -P"sa" '
EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;
exec master..xp_cmdshell 'bcp "SELECT * FROM emergency.dbo.log" queryout c:\bb.xls -c -S"wzp" -U"sa" -P"sa" '
转载于:https://www.cnblogs.com/nanshouyong326/archive/2009/10/19/1585766.html