Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 4th, 2004, 12:22 PM
Authorized User
 
Join Date: Jun 2003
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.
 
Old February 4th, 2004, 12:44 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
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
 
Old February 4th, 2004, 03:22 PM
Authorized User
 
Join Date: Jun 2003
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.
 
Old February 4th, 2004, 08:19 PM
Registered User
 
Join Date: Feb 2004
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







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





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