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.
| Author |
Topic |
|
ArpitNarula
Starting Member
16 Posts |
Posted - 2011-01-14 : 04:54:46
|
| Problem:Table A in Database A1Table B in Database B1Above 2 databases are in same instance of the SQL server.I need to compare their structures. In Oracle somthing likedescribe Auniondescribe BPlease advise.Thanks in advance. |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-01-14 : 05:10:13
|
| in the SSMS select the table name and press Alt+F1 you will get same as Oracle's "Desc TableName" but you will need to copy the result into Excel .. do same for another table and copy the result into Excel.... And compare there :D with Union ..!!! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-01-14 : 05:26:11
|
| orEXEC sp_columns 'A'EXEC sp_columns 'B'MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-01-16 : 05:42:10
|
you can even write a query on catalog view INFORMATION_SCHEMA.COLUMNS to get it.like USE [A1]GOSELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'A'UNION ALLSELECT * FROM B1.INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'B' ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
ArpitNarula
Starting Member
16 Posts |
Posted - 2011-01-17 : 00:36:26
|
| Thanks a lot for your reply's guys.That has been really helpful. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-01-24 : 11:15:11
|
| wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|