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 fire order and multiple statements

Author  Topic 

OMB
Yak Posting Veteran

88 Posts

Posted - 2004-07-14 : 08:14:21
Hi guys,

I have a trigger on SQL 2000 that runs for both INSERTs and UPDATEs. I need this trigger to run before any others on the table.

I know you can use sp_settriggerorder to identify the first trigger to run, but in the parameters it specifies a statement type (i.e. INSERT). My question is, the documentation doesn't cover triggers that run for multiple statements (i.e. INSERT and UPDATE) - can this method still be used to get the trigger to run first?

i.e @stmttype = insert,update

If so, what would be the syntax?

Thanks in advance!

OMB

Kristen
Test

22859 Posts

Posted - 2004-07-14 : 08:22:59
Can you duplicate the sp_settriggerorder command for each of INSERT and UPDATE? AFAIK you are allowed one FIRST trigger for INSERT, and one for UPDATE and so on

Kristen
Go to Top of Page

OMB
Yak Posting Veteran

88 Posts

Posted - 2004-07-15 : 03:46:06
Thanxs kristen,

I thought you could'nt have more than one first trigger. Having read it agin after your post I see that u can as long as it is on different statements.

Cheers

OMB
Go to Top of Page
   

- Advertisement -