database-comparison

How to compare same DB for their Schema and Tables?

本秂侑毒 提交于 2019-12-12 03:45:01
问题 I am using SQL SERVER 2008 R2, I have two same DB, ABC (with only structure like schemas, tables but no data in the table) ABC1 (with schemas, tables and data in the tables) How can I compare #1 & #2 for their Schema and Tables, do we have any software for it or we can do it in the SSMS itself. 回答1: You can write a sproc which will do this for you. 1.Lets get all the tables from ABC into a table variable or temp table. 2.Loop through the temp or table variable and get each table at a time. 3