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)
 Trigger question.

Author  Topic 

eastcoaster
Starting Member

17 Posts

Posted - 2006-08-07 : 21:45:10
Sorry for my ignorance, but if I start my statement with ...

CREATE TRIGGER Employee_seniority_10 ON employee FOR insert as
BEGIN
declare @numrows int

This will only work if there is a new record inserted in Employee table. To run the trigger when the table is updated, should I write the trigger as ...

CREATE TRIGGER Employee_seniority_10 ON employee FOR update as
BEGIN
declare @numrows int

Thanks for your help in advance.

Kristen
Test

22859 Posts

Posted - 2006-08-07 : 22:11:33
You could use

FOR insert, update

and then the same trigger would be fired for both conditions

Kristen
Go to Top of Page
   

- Advertisement -