How can I set up a conditional trigger to be fired when a particular condition is met after an update or insert and then insert some of the inserted values into another table located on another SQL Server database on SQL Server 2005?
1 Answer
Read here about creating triggers. In your case it will be a normal data manipulation language (DML) event trigger.
In order to insert data to a remote server you need to configure a linked server. You have a few tools for that: you can either use SQL via sp_addlinkedserver, or you can use SQL Server Management Studio (SSMS). In latter case you will be able to do it via GUI. See this article for the instructions.
Once you configure the linked server, you can access its tables directly from SQL (In the example below a linked server SRVR002\ACCTG is used):
SELECT name FROM [SRVR002\ACCTG].master.sys.databases