Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 4th, 2004, 12:22 PM
Authorized User
 
Join Date: Jun 2003
Location: , , Romania.
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
Default two databases, one schema

problem: i have two databases with the same structure (i mean the same tables, table columns, pks, check constraints, stored procedures, views, udfs, ..., you get the ideea...). is there a way to ensure that any schema modification to one of them will be automatically done to the other also?

for example, let's say i want to add a unique constraint in one of the databases on one of the tables. what i want is that this constraint to be added automatically to both databases or, if the constraint is not possible, to none of them.

thanks,

defiant.
Reply With Quote
  #2 (permalink)  
Old February 4th, 2004, 12:44 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is one a development and one a master?
What I would do is create a view from the systables and compare any items from one that do not match another. This gives you a list of changes.

Making any changes automatically to the other schema could cause probles if you are adding a PK and the values are not unique. The schema can be the same, but the data will not match.





Sal
Reply With Quote
  #3 (permalink)  
Old February 4th, 2004, 03:22 PM
Authorized User
 
Join Date: Jun 2003
Location: , , Romania.
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sal, you say that "Making any changes automatically to the other schema could cause probles if you are adding a PK and the values are not unique. The schema can be the same, but the data will not match." in this case i don't want the pk to be added in _either_ databases. i want the database's structure to be exactly equivalent all the time.

you say that "What I would do is create a view from the systables and compare any items from one that do not match another. This gives you a list of changes." ok, let's supose that i'm giving up the ideea of not manually making a change twice. than i need to know all the differences, not only what tables and columns, but all, including encrypted stored procedures, constraint names and content, etc. i will have to see if this is possible... but i would prefer to make the changes and the change to be automatically done in the 2nd database :).

defiant.
Reply With Quote
  #4 (permalink)  
Old February 4th, 2004, 08:19 PM
Registered User
 
Join Date: Feb 2004
Location: panchkula, haryana, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sumit1228 Send a message via Yahoo to sumit1228
Default

defiant,

There is a utility named 'dbsynchrocompsetup.exe' which gives you the differences between the two databases including all objects and even users. You can even select the option for that. But you have to download this from net.It's free to use for 30 days evaluation.

Now, regarding your problem of automating changes in second database, i donn't have anything to say as if data is same then it's very easy otherwise not. You can write stored procedure in which you will pass the query(changes) and then run on one database and then on second . if it runs well then ok otherwise undo the changes in both database. For that you have to keep the stored procedure in master database.

sumit


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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conforming to a schema Chamkaur XSLT 1 January 8th, 2007 06:03 AM
Schema Validation markus2000 XSLT 1 June 22nd, 2006 08:23 AM
Schema to Schema conversion onlyda XSLT 5 March 23rd, 2006 12:25 PM
Schema help!? beerni XML 3 October 14th, 2005 08:24 AM
Schema gabrieldg74 XML 0 August 16th, 2005 05:42 PM



All times are GMT -4. The time now is 11:18 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.