Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a two tables and want to update one table on update of second table of perticular column with value as 'CLOSE'

e.g. table1 has a columns as userid and ticketcount
table2 has a columns ticketno,ticket_status and userid

when ticket_status of userid 'user1' has changed from 'OPEN' to 'CLOSE' in table2 ==>
ticketcount should update of that userid
Posted
Comments
Can you please show us what have you tried so far to achieve this ?

1 solution

See http://stackoverflow.com/questions/280904/trigger-to-fire-only-if-a-condition-is-met-in-sql-server[^] for a similar question.

Build the logic into the trigger using a IF-statement.
This means that the trigger is always fired, but you determine whether to act on it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900