-
-
Save hoangitk/4e0081f72bcf9e3749d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE master | |
GO | |
EXEC sp_configure 'show advanced options', 1 | |
GO | |
RECONFIGURE | |
GO | |
EXEC sp_configure 'xp_cmdshell', 1 | |
GO | |
RECONFIGURE | |
GO | |
--examples 1 | |
EXEC xp_cmdshell 'ipconfig' | |
GO | |
--examples 2 | |
declare @sql varchar(8000) | |
select @sql = 'bcp "sp_mystore ''2015-01-01'', ''2015-01-31''" queryout D:\Ouput201501.xls -c -t, -T -S' | |
exec master..xp_cmdshell @sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment