我使用SQL Server 2008 R2, 我有兩個相同的DB,如何比較相同的數據庫的架構和表?
- ABC(與像模式,表,但沒有數據在 表只有結構)
- ABC1(與模式,表和表中的數據)
我如何比較#1 &#2的模式和表,我們是否有任何軟件或者我們可以在SSMS本身做到這一點。
我使用SQL Server 2008 R2, 我有兩個相同的DB,如何比較相同的數據庫的架構和表?
我如何比較#1 &#2的模式和表,我們是否有任何軟件或者我們可以在SSMS本身做到這一點。
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.Get all the column names,datatypes etc for this table and similarly get the same details for the same table from ABC1 database.
4.Also create one final result table where you just update the status against each table as match or nomatch
5.Repeat this for all the tables in the table variable.
您可以使用以下軟件進行比較數據庫模式:
Redgate SQL Compare
更爲用戶比其他友好。
您還可以嘗試ApexSQL Diff - 一種SQL Server數據庫比較和同步工具,用於檢測數據庫對象之間的差異。它產生於發現差異的綜合報告,並可以自動實時和版本的數據庫,備份,快照和腳本之間的同步處理文件夾
視頻 - Introduction to ApexSQL Diff
聲明:我ApexSQL工作作爲支持工程師
可以請你指導或幫我寫 –
ok.do你有這些dbs在同一臺服務器上或不同的服務器上? – AnandPhadke
它在同一臺服務器即上(本地) –