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
 Transact-SQL (2000)
 UPDATE from inside a trigger

Author  Topic 

newsqlguy
Starting Member

13 Posts

Posted - 2004-02-29 : 14:57:24
Hi All,

I have trigger on a table for INSERT and on insert to the table I want to update another record in same table with a value.

for example:

UPDATE table1.isvoided = 1
WHERE table1.idcolumn = INSERTED.voidid

Of course the above is not the right syntax but I couldn't make up the right syntax for the trigger. so, please if someone here can help me with this I will appriciate it very much.

Thanks ahead,
newsqlguy.

safigi
Starting Member

15 Posts

Posted - 2004-02-29 : 15:38:38
update t
set isvoided=1
from table1 as t
join inserted as d on d.idcolumn=t.idcolumn

quote:
Originally posted by newsqlguy


I have trigger on a table for INSERT and on insert to the table I want to update another record in same table with a value.
for example:
UPDATE table1.isvoided = 1
WHERE table1.idcolumn = INSERTED.voidid

Go to Top of Page
   

- Advertisement -