Search code examples
sql-server-2008sql-server-2008-r2sql-server-2008r2-express

How to generate the Alter,Update & Create Script in SSMS?


Hi I am using SQL SERVER 2008 R2, I have 2 databases

1] ABC (with only structure like schemas, tables but no data in the table) 
2] ABC1 (with schemas, tables and data in the tables)

I did the comparision at Schema and Tables level, I found a table altered in #2 but not in #1 ,I want to know how can I generate the alter script to alter table in #1 ? And how can I generate the Alter,Update & Create Script which are missing in #1 ? 1st is the old DB and #2 is new .


Solution

  • You can use software for compare same DB schema. this software after compare database schema between multi DB, get you script for unifying DBs.

    for example in redgate software :

    enter image description here

    1. See Compare result for selected object
    2. select object that want to unify
    3. start unifying dbs