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)
 Create Trigger

Author  Topic 

seyha_moth
Yak Posting Veteran

74 Posts

Posted - 2007-05-09 : 23:37:42
Dear sir or madam

I have a problem related to creating trigger in sqlserver 2000.I want to create trigger:
CREATE TRIGGER trX_ExamScore
ON tblX_ExamScore
FOR INSERT,UPDATE,DELETE
AS
Wanted statement
I want to write statement to control when:
-User insert then it will insert to a table
-User Delete then it will update to a table
-User Update then it will insert to a table

I look forward to hearing from you
Thank you in advance!

Best regard,

seyha moth

PeterNeo
Constraint Violating Yak Guru

357 Posts

Posted - 2007-05-10 : 01:56:39
Check the topic "Using the inserted and deleted Tables" in BOL
and use those tables for Inserting or Updating the values into the Tables.
From BOL :
When you set trigger conditions, use the inserted and deleted tables appropriately for the action that fired the trigger.
Go to Top of Page
   

- Advertisement -