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

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL Trigger

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-16 : 09:54:19
wan writes "Hi,

I have two sql servers, let's give it a name sql-A and sql-B. What I want to do is, when i update a record in sql-A, I would also like to insert a record in sql-B. What would be the trigger command to do this scenario or is there a better way of doing thing.

TKS."

mfemenel
Professor Frink

1421 Posts

Posted - 2002-01-16 : 11:22:50
Replication would also work in this case if you don't mind a delay in the update of the 2nd table. To do the trigger for this, you'd do something like:

Create trigger for update
as
select * from inserted
into
server.database.dbo.tablename

or if you just want particular fields, you can refine your select statement a little.

Mike
"A program is a device used to convert data into error messages."
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2002-01-16 : 12:50:40
You wouldn't want to do a 'select into' as that would create a new table. You would do an INSERT statement. You should create linked servers for these 2 servers so the 4 part syntax listed above will work correctly.

-Chad

Go to Top of Page
   

- Advertisement -