Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Still cant get my trigger to work?

Status
Not open for further replies.

Linkan

Programmer
Feb 7, 2001
44
SE
Hello,

I am new to this and on my way to learning. I hope someone can help me with a trigger. I want to update status of one table when I insert a new threat in another. This is what I have come up with so far.

CREATE TRIGGER [trg_Update_Status] ON tForumThread
FOR INSERT
AS
BEGIN
UPDATE tJournalTopic (STATUS_ID)
SELECT STATUS_ID
FROM Inserted

Thanks,
Linkan
 
UPDATE tJournalTopic (STATUS_ID)
SELECT STATUS_ID
FROM Inserted


Somewhat unusual, since usually you would be inserting a record into the other table. To use the UPDATE statement, you'll need to use the form SET COLUMNNAME=

when I insert a new threat
Sounds like a pretty violent application.

Robert Bradley
Got extra money lying around? Visit:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top