Results 1 to 2 of 2

Thread: Triggers

  1. #1
    Join Date
    Dec 1969

    Default Triggers

    hi, <BR><BR>i have a doubt in triggers. there are 2 database in my sql server. one is local and another is remote server. when a row is inserted into the table in the remote server, the record has to be reflected in my local server. can i use trigger for the same. if so how should i? or if i cannot write, can u suggesst me some alternative.<BR><BR>regards,<BR>jothi

  2. #2
    Join Date
    Dec 1969

    Default RE: Triggers

    I believe you can. You may have to set it up as a linked server, though (Google is a good bet).<BR><BR>[code language="T-SQL"]<BR>CREATE TRIGGER myTrigger ON MyTable FOR INSERT<BR><BR> INSERT INTO MyRemoteServer.MyDatabase.dbOwner.MyTable<BR> (MyValue1, MyValue2)<BR> SELECT MyCol1, MyCol2 FROM INSERTED<BR><BR>GO<BR>[/code]<BR><BR>Craig.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts