Vikash p
asked on
Help in writing trigger
Hi I have two tables.
Table1
Client_ID int Identity (PK)
ClientName Varchar(50)
gender Bit
Address varchar(300)
Status char(1)
and a Log table
Table_History
History_ID int Identity(1,1) (PK)
User_ID int
FieldEffected varchar
Olddata varchar
newdata varchar
timestamp datetime
can any one help me in writing trigger for Insert , Update and delete . for timebeing I can fix user_ID as '1000001'
Table1
Client_ID int Identity (PK)
ClientName Varchar(50)
gender Bit
Address varchar(300)
Status char(1)
and a Log table
Table_History
History_ID int Identity(1,1) (PK)
User_ID int
FieldEffected varchar
Olddata varchar
newdata varchar
timestamp datetime
can any one help me in writing trigger for Insert , Update and delete . for timebeing I can fix user_ID as '1000001'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
When you compare the old and new values, you also need to compare correctly to allow NULL value(s) to be on one side or the other or both.