sql server 导入导出向导 - 启用身份插入不起作用
我正在使用 sql server 2008。我在 A 服务器(源)上有一个 ABC 数据库。现在我想将该数据库的所有架构和数据复制到 B 服务器(目标)上的新数据库 XYZ。为此,我正在使用 sql服务器导入向导。
现在的情况是:
在 ABC 数据库中,许多表都将标识列作为主键。当我使用导入向导时,我将“启用标识插入”设置为 True(选中)。 但导入过程完成后,我发现目标表已创建,但未设置表的主键,也未设置身份。
它只是复制数据,而不复制主键或身份字段。
如何使所有表的“身份插入”工作成为可能,
请提前帮忙。谢谢。
I am using sql server 2008.i have one ABC database on A server(source).now i want to copy all the schema and data of this database to my new database XYZ on B server(destination).for this i am using sql server import wizard.
now the scenario is:
In ABC database,many tables have identity columns as primary key.when i use import wizard, i set "Enable identity insert" to True(checked).
but import process completes,i found that destination tables are created but primary keys are not set for tables and also identity is also not set.
It just copies the data,not the Primary keys or identity fields.
How to make it possible to work for "identity insertion" for all tables
Pls help.thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想复制整个数据库,最好尝试复制数据库向导,而不是导入/导出。此功能仅复制数据。 启用标识插入只是告诉向导在将数据插入到具有 IDENTITY 的列时使用 SET IDENTITY_INSERT ON/OFF 命令 - 它不会设置列的 IDENTITY 参数。
If you want to copy entire database better try Copy Database wizard, not Import/Export. This feature just copies data. Enable identity insert just tells the wizard to use SET IDENTITY_INSERT ON/OFF commands when inserting data to columns with IDENTITY - it doesn't set the IDENTITY parameter of the column.
尝试使用这些
SQL 架构比较:
http://www.codeproject.com/KB/database/ SQLCompare.aspx
SQL 数据比较
http://www.codeproject.com/KB/database/DataCompareTool.aspx
try using these
SQL SCHEMA Comparison:
http://www.codeproject.com/KB/database/SQLCompare.aspx
SQL DATA Comparision
http://www.codeproject.com/KB/database/DataCompareTool.aspx