简体   繁体   English

将SQL Server 2008数据库转储为XML

[英]Dump sql server 2008 database to XML

I need a full dump of my SQL server database in one large XML file. 我需要将我的SQL Server数据库完整转储到一个大的XML文件中。 I need to get all the tables, except on some tables I need to exclude specific columns, (columns with raw data). 我需要获取所有表,但在某些表上,我需要排除特定的列(带有原始数据的列)。

How can I do this? 我怎样才能做到这一点?

I am using SQL server 2008 R2. 我正在使用SQL Server 2008 R2。

Never tried it, but I believe you can use the bulk export option of bcp : 从未尝试过,但我相信您可以使用bcp的批量导出选项:

From SQL Server Books on-line: 从SQL Server联机丛书中:

"E. Bulk exporting XML data The following example uses bcp to bulk export XML data from the table that is created in the preceding example by using the same XML format file. In the following bcp command, and represent placeholders that must be replaced with appropriate values: “ E.批量导出XML数据下面的示例使用相同的XML格式文件,使用bcp从上一个示例中创建的表中批量导出XML数据。在下面的bcp命令中,代表必须用适当的位置替换的占位符值:

bcp bulktest..xTable out a-wn.out -N -T -S<server_name>\<instance_name>

"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM