您的位置:首页 > 博客中心 > 数据库 >

sql生成excel

时间:2022-03-14 00:51

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"go@1014903"‘
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"go@1014903"‘

热门排行

今日推荐

热门手游