MSSql Server 自定义导出

EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE
GO


exec master..xp_cmdshell 'bcp "SELECT SOME FROM 数据库.dbo.表 " queryout "D:\1.txt" -c -t -S服务器 -U账号 -P密码'

GO

EXEC sp_configure 'xp_cmdshell', 0
GO
RECONFIGURE
GO


EXEC sp_configure 'show advanced options', 0
GO
RECONFIGURE
GO

posted @ 2016-05-09 10:38  次奥君  阅读(217)  评论(0编辑  收藏  举报