您的位置:首页 > 数据库

SQL BCP命令生成XML文件

2008-09-17 11:47 417 查看
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO

EXEC('EXEC master..xp_cmdshell ''bcp "SELECT * FROM server3.swfc.dbo.user_tbl FOR XML AUTO, ELEMENTS" queryout "c:/xml.xml" -c -S"server3" -U"sa" -P"1234" '' ')

bcp "select * from swfc..user_tbl for xml auto, elements " queryout c:/a1.xml -c -Sserver3 -Usa -P1234

EXEC master..xp_cmdshell 'bcp "select * from swfc..user_tbl for xml auto, elements " queryout c:/a1.xml -c -Sserver3 -Usa -P1234'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐