在SQL

时间:2015-04-22 11:33:48

标签: sql-server sql-server-2008 tsql

我有两个数据库Test and Live。我想将所有数据从Live数据库推送到Test数据库。此外,我想在数据迁移之前比较两个数据库的模式/结构,以便了解是否存在任何模式/结构更改。 测试数据库包含旧数据,我想用Live中的新数据替换它。
这样做的最佳方法是什么。

1 个答案:

答案 0 :(得分:0)

1.If you are using Visual Studio 2012 then do the Schema Compare for Both Test and Production Environment .make sure that both environments 
datatypes and Key Constraints Remain the Same.Then do the Generate Scripts of Production Database and execute it on Test new database 
2. Now Just take the Shrink backup or Compressed Mode back up of your Production Environment.
3.Now in the Test Environment Create New Database or Replicate of your Existing Database 
Right Click on new Database -> Genrate Script option 
4.Then Execute the Database script with new file groups 
5.Now Restore the Production backUp on Test BackUp with click overwrite