Updating 2 SQL Server databases at the same time

  • I am coding in asp and I have a form that updates a SQL server 2000 database but I want to actually update 2 exact databases but on different servers when the update button is clicked.

    Is this possible and is there and samples avaible for this.

  • You will have to build a distributed transaction. See Books Online for "BEGIN DISTRIBUTED TRANSACTION".

  • If the databases are the same, and therefore the stored procedures are also the same, depending on the complexity of you application model (i.e. n tier architecture) you could simply change the database that you asp calls the sp from and run the same thing twice.

    If your app is a relatively straight forward one, this would probably be better that creating a middle tier.

  • You have several options. These are just some:

    1- you could use a trigger in one to update the other using three part names

    2- you could use a linked server and call it within the sp in one of them to run the procedure in the other with same parameter (USING DISTRIBUTED TRASACTIONS On the server side)

    3- you could use transactional replication

    4 - you could implement a distributed transaction from the client side using COM+)

    It is up to you to decide what's better for your particular environment

    HTH


    * Noel

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply