0

We have 2 databases: QMS and QMS_Chennai.

QMS contains these tables:

tbl_table1
tbl_table2
tbl_table3

QMS_Chennai contains these tables:

tbl_table1
tbl_table2

The tables in the QMS database contain a few columns which are not in the same tables in the QMS_Chennai database.

I need to check what tables are present in both databases and add the additional columns to tables in the QMS_Chennai database from QMS.

Need to write some query as we have to face this scenario number of times in case of different databases. We are using SQL Server 2008 R2

Thanks

2 Answers 2

2

Schmea Compare from VS 2010 will help you in this. Link for more details. Schema Compare

For higher version of VS i.e VS 2012 check this Schema Compare

or for Vs 2013 this Schema Compare

Sign up to request clarification or add additional context in comments.

Comments

0

you can get the table name which are present in both table by this query:-

  select * from QMS .INFORMATION_SCHEMA.TABLES as bb 
  inner join QMS_Chennai .INFORMATION_SCHEMA.TABLES as cc
  on bb.TABLE_NAME=cc.TABLE_NAME

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.