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)
 Trigger on Insert, Update

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-15 : 08:56:32
Tracey writes "I'm having a problem trying to create a trigger that when a field is updated in one table, the trigger would fire off and update the same field within another table. I have tried all types of samples off the internet and have little luck. Could you please direct me into the right direction to do this properly?

Thanks,

Tracey Robinson
East Baton Rouge Sheriff's Office
Computer Operations"

Nazim
A custom title

1408 Posts

Posted - 2002-01-15 : 09:58:38
This should give you some idea on how to do it.
update table t set t.fieldname=i.fieldname from inserted i
where t.pk=i.pk

Read this Articles on Triggers by Garth

http://www.sqlteam.com/item.asp?ItemID=3850
http://www.sqlteam.com/item.asp?ItemID=6494

HTH

----------------------------------
"True love stories don't have endings."
Go to Top of Page
   

- Advertisement -