Search This Blog

Wednesday, January 12, 2011

Export SQL to XL

EXEC sp_configure 'show advanced options', 1;GO
RECONFIGURE
;GO
EXEC
sp_configure 'xp_cmdshell', 1GO
RECONFIGURE
;EXEC master..xp_cmdshell 'bcp "Select * from sys.tables" queryout "C:\kl.xls" -c -T -S'

No comments:

Post a Comment