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.
Author |
Topic |
indra_saha
Starting Member
2 Posts |
Posted - 2008-09-25 : 16:51:31
|
Hi, I am writing a single trigger in T-SQL (in SQL Server 2000) for Insert, Update, Delete on a table.Inside the body of that trigger I want to perform operation based on what event (insert or update or delete) has occurred.How will I know and catch the event inside the trigger body.Any code example will be highly appreciated.Thanks in advance,Rabi |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2008-09-25 : 17:09:56
|
It is probably simpler and more efficient to do a differnt trigger for each one. You can tell by doing a count of the inserted and deleted tables. If both have rows, it is an update.CODO ERGO SUM |
|
|
indra_saha
Starting Member
2 Posts |
|
|
|
|