go
sp_configure ‘show advanced options‘,1
reconfigure
go
sp_configure ‘xp_cmdshell‘,1
reconfigure
go
EXEC master..xp_cmdshell ‘bcp "SELECT * FROM TestDB.dbo.Test " queryout "c:\test.xls" -c -q -S. -U"sa" -P"[email protected]"‘
GO
sp_configure ‘xp_cmdshell‘,0
reconfigure
EXEC master..xp_cmdshell ‘bcp "SELECT * FROM TestDB.dbo.Test " queryout "c:\test.xls" -c -q -S. -U"sa" -P"[email protected]"‘
时间: 2024-10-18 22:20:10