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'
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'
相关文章推荐
- 命令行方式使用abator.jar生成ibatis相关代码和sql语句xml文件
- Android命令生成编译出build.xml文件
- 存储过程中执行bcp命令将数据导入 并在其他文件服务器上生成log文件
- sql for xml: 生成树型结构的xml文件 (sql for xml to tree )
- SQL Server利用bcp命令把SQL语句结果生成文本文件(动态生成文件名)
- 数据库操作_连接SQL Server数据库示例;连接ACCESS数据库;连接到 Oracle 数据库示例;SqlCommand 执行SQL命令示例;SqlDataReader 读取数据示例;使用DataAdapter填充数据到DataSet;使用DataTable存储数据库表;将数据库数据填充到 XML 文件;10 使用带输入参数的存储过程;11 使用带输入、输出参数的存储过程示;12 获得数据库中表的数目和名称;13 保存图片到SQL Server数据库示例;14 获得插入记录标识号;Exce
- 动态生成mybatis的xml文件,其中的sql语句生成
- [原创]java WEB学习笔记81:Hibernate学习之路--- 对象关系映射文件(.hbm.xml):hibernate-mapping 节点,class节点,id节点(主键生成策略),property节点,在hibernate 中 java类型 与sql类型之间的对应关系,Java 时间和日期类型的映射,Java 大对象类型 的 映射 (了解),映射组成关系
- 用vs2012的命令利用xsd文件生成对应的C#类,把xml的string类型映射到生成的类
- SQL Server利用bcp命令把SQL语句结果生成文本文件
- SQL Server利用bcp命令把SQL语句结果生成文本文件
- Android命令生成编译出build.xml文件
- dd命令生成一个大文件
- Linux下mysql命令 导入 导出sql文件
- 利用fsutil命令生成指定大小的文件
- kali linux 生成后门文件命令:PHP,java,Linux,windows,android
- LINQ to XML 从逗号分隔值 (CSV) 文件生成 XML 文件
- MySQL执行外部sql脚本文件的命令
- generator.xml文件自动生成mybatis的xml配置
- 命令行下使用javah命令生成.h文件,出现“错误: 无法访问android.app.Activity 找不到android.app.Activity的类文件”的解决方法