SQL Server Performance

synchronizing two databases using triggers

Discussion in 'Getting Started' started by redddy, Oct 14, 2008.

  1. redddy New Member

    hi all,
    i am new to triggers
    i have two databases with similar tables . i need to write a trigger such that when data is inserted in to the first database , the trigger should be fired and update the second database with the same data. need help very quickly.........................
  2. redddy New Member

    help needed very quickly.....................
  3. Adriaan New Member

    I doubt this problem can be all that urgent. In any case, triggers are not the most obvious choice.
  4. moh_hassan20 New Member

    If i understand you, you have two typical database same structure and same data
    Is it true?
    Any way, the scope of trigger is the same database only , no side effet on other database.
    can you explain what you need from second database, may we help.
  5. redddy New Member

    what i need is replication of one db to another db .
    i am considering two ways for it
    1.when ever some event happens on the first db , trigger should be generated to update the same in the second db
    2.copy the whole first db to the second db on a scheduled basis.
    which one do you think would be appropriate solution?
  6. moh_hassan20 New Member

    1)if you have sql 2005 Enterprise Edition, you can crate snapshot database (readonly) on the same server
    you can scedule creating it.

    2)If the two database on different servers, you can use snapshot replication (or other type of replication)
    3)You can also do replication on the same server (in that case it is used as Publisher, Subscriber and Distributor databases)
    but that may effect the performance
  7. redddy New Member

    thnx hassan and satya for feedback
    i will soon get back with more information
  8. satya Moderator

    Still more information is required such as the size of database, number of users and transactions that are happening on this first database including the location of these databases (same server or different server).
    Having such an information will help us to identify the issue and provide a suggestion that suits your need, in this case replication is best option to consider such a data update between the servers.

Share This Page