Click here to Skip to main content
15,885,651 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can we create trigger for the same table ?
Posted
Comments
Stephen Hewison 20-Mar-15 11:54am    
Not a very good question. Please provide an example, what have you tried, what problems are you having?
Pramod Singh (C) 20-Mar-15 12:44pm    
Can we create trigger on the same table?

Eg . Insert into TableA(ID, Name) Values(1,'Pramod')

Can we write :
Create trigger ABC ON TableA
After INSERT
AS
Update TableA Set Name='XYZ' where id=1
GO

So is it right the above trigger ? is it working or Not ? im just confuse...
Stephen Hewison 20-Mar-15 20:11pm    
Yes you can. But you should look at a parameter called trigger level. This will stop infinite recursion.

1 solution

Yes.

Added to make the answer long enough to post.
 
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