Link to home
Start Free TrialLog in
Avatar of janeb
janeb

asked on

Use Trigger to Update Remote Database

I know how to use triggers to update another local table in the same database. But can I use triggers to insert a record to a table in a remote database when a local table is being updated/inserted? How and what do I need to do?
ASKER CERTIFIED SOLUTION
Avatar of tchalkov
tchalkov

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of janeb
janeb

ASKER

What's a linked server? How do I do that?
Avatar of janeb

ASKER

What's a linked server? How do I do that? Let me know if you need more points for that.
a linked server is a remote database which you can connect to your sql server and use it as local.
You can create a linked server by using Enterprise manager. Open your server, then open Security and there is a folder called Linked Servers. If remote server is SQL Server then it is easy to add - choose SQL Server from teh dialog box, and as name of the linked server enter the name or your remote server. Then in your queries you can use the following syntax to refer remote tables:
remote_server_name.remote_database_name.dbo.remote_table_name

here if dbo is not owner of the remote table you must change dbo with the appropriate user name.
Read in books online about linked  servers - hope this helps