If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Differentiating between two Schemas

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-12-11, 07:10
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
Differentiating between two Schemas

Hi,
Is there anyway to differentiate between two schemas between two SQL server instances?
Reply With Quote
  #2 (permalink)  
Old 12-12-11, 10:57
onansalad onansalad is offline
Registered User
 
Join Date: Nov 2003
Posts: 159
Would depend on what you mean by "differentiating." While I haven't tried this with two instances on the same server, I've often created linked servers across two different servers so I can reference them with the linked server syntax. For instance - to find records in a prod table that don't exist in a dev table:

Code:
select       *
from         [SERVER1].[DBNAME].[SCHEMA].[OBJECTNAME] x left outer join 
             [SERVER2].[DBNAME].[SCHEMA].[OBJECTNAME]y on x.id=y.id
where        y.id is null
__________________
Kit Lemmonds

Last edited by onansalad; 12-12-11 at 10:58. Reason: code error
Reply With Quote
  #3 (permalink)  
Old 12-12-11, 19:36
shendricks shendricks is offline
Registered User
 
Join Date: Nov 2011
Posts: 6
If you are looking for differences in schema definitions, I'd use a third party tool. The Red Gate SQLCompare is what I've used with good results. It will generate the scripting needed to sync the schemas, too.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On