Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to create a trigger to update data in another
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

57 Posts

Posted - 05/16/2013 :  09:27:52  Show Profile  Reply with Quote

I am new to creating a trigger in sql server so I need your help.

I have 2 sites, 2 databases (same name) on 2 different servers, S1 & S2. These database are the same name, tables, data, 100% the same.

I am using ASP to code. Currently, I have to enter data for each website, which is 2 times.

How can I create a trigger so that everytime there is an update in database in Server1, then the database in Server2 gets updated.

Thank you very much!

Aged Yak Warrior

549 Posts

Posted - 05/16/2013 :  10:34:07  Show Profile  Reply with Quote
Refer to this:
Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 05/17/2013 :  00:05:22  Show Profile  Reply with Quote
why not simply apply replication if attempt is to keep both databae objects in sync?

SQL Server MVP
Go to Top of Page

Flowing Fount of Yak Knowledge

United Kingdom
2179 Posts

Posted - 05/17/2013 :  01:55:15  Show Profile  Visit jackv's Homepage  Reply with Quote
Triggers utilised in this style - could cause all sorts of problems. The most obvious one being integrity of data\troubleshooting .
Couldn't you operate 1 database server? ,

Jack Vamvas
Go to Top of Page

Aged Yak Warrior

700 Posts

Posted - 05/17/2013 :  06:08:23  Show Profile  Reply with Quote
Depending on what you want, another approch is to use the Service Broker. The following should give you an idea:

Edited by - Ifor on 05/17/2013 06:09:27
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000