简体   繁体   English

Microsoft SQL Server Management Studio,导入导出向导创建本地副本,需要主外键

[英]Microsoft SQL Server Management Studio, Import and Export Wizard to create local copy, need primary and foreign keys

I need to make a local copy of our QA database to test out a few queries before committing.我需要制作 QA 数据库的本地副本,以便在提交之前测试一些查询。 I was able to create a local database / download and import the data from the QA to my local copy using the Import and Export Wizard, but none of the primary key & foreign key mappings came with it.我能够使用导入和导出向导创建本地数据库/下载并将数据从 QA 导入到我的本地副本,但没有主键和外键映射随附。

Is there a way to get those too?有没有办法得到这些?

Long story short is I need to delete and replace some of the QA data.长话短说是我需要删除和替换一些 QA 数据。 Colleague told me I would need to do a 'on delete cascade' for it work probably.同事告诉我,我可能需要做一个“删除级联”才能工作。 I was going to test out my script first on a local copy, but the local copy is missing all of the keys we have in our QA.我打算首先在本地副本上测试我的脚本,但是本地副本缺少我们在 QA 中拥有的所有密钥。

如果要制作包含所有设置的数据库的副本,您可能需要使用备份和还原命令。

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

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