Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Alter the difference of 2 tables

Author  Topic 

d3ng
Yak Posting Veteran

83 Posts

Posted - 2008-11-03 : 01:57:22
Hi SQL Experts,

I would like to know how to get the field diffence of 2 tables. Here is my scenario. I have 2 database of our clients, database a and database b, both of them have a table mytable. Basically I want to know the difference of the 2 identical tables in 2 different database so that I can alter the missing fields.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-03 : 02:03:44
you mean structure wise or data wise? i.e missing column info or missing record info?
Go to Top of Page

ayamas
Aged Yak Warrior

552 Posts

Posted - 2008-11-03 : 02:05:26
I think you will have to use some third party tool.I had use SQLcompare before.It is quite good.You can have look at it here.
http://www.red-gate.com/products/SQL_Compare/index.htm
It has a 14 day free trial.
Go to Top of Page

d3ng
Yak Posting Veteran

83 Posts

Posted - 2008-11-03 : 02:26:55
quote:
Originally posted by visakh16

you mean structure wise or data wise? i.e missing column info or missing record info?



Structure wise! =j

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-03 : 02:48:42
i dont think there's a direct way to do that. You can however use INFORMATION_SCHEMA.COLUMNS to compare columns on both db and alter accordingly.
Go to Top of Page

d3ng
Yak Posting Veteran

83 Posts

Posted - 2008-11-03 : 03:13:55
quote:
Originally posted by visakh16

i dont think there's a direct way to do that. You can however use INFORMATION_SCHEMA.COLUMNS to compare columns on both db and alter accordingly.




I already used information_schema. Anyway, thanks for the time and effort guys!
Go to Top of Page
   

- Advertisement -