Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert into table on another server

Status
Not open for further replies.

dpm1234

Programmer
Aug 27, 2003
9
US

I'd like to create a trigger on a table in db1 that is located on server1, that will insert a row into a table in db2 on server2. Something like:

insert into svr2.db2.dbo.table2 ....

Anyone have any ideas?
 
Try this...but I didnt test it

First of all,create linked server which connect to svr2

Then in the Srv1.db1 database execute the following query

Create Trigger tr_itable1 on table1 for insert
as
insert into srv2.db2.dbo.table2 select * from inserted
 
That sounds great, but can you give me a tip on how to create a linked server?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top