Murali Bala
Murali Bala

Reputation: 81

Is it possible Looping in trigger

My Trigger is on the table affected here:

UPDATE TABLE_NAME SET VALUE = @VALUE

now i execute the above query means trigger will execute now

TRIGGER
AFTER UPDATE
AS
BEGIN
.
.
UPDATE TABLE_NAME SET VALUE = @VALUE 
.
.
END

now 2nd update query execute means again trigger will execute or not this is my question.

Upvotes: 0

Views: 194

Answers (1)

gbn
gbn

Reputation: 432210

Maybe

In SQL Server, this is "direct trigger recursion"

This is controlled by 2 things

For full details, see Create Nested Triggers on MSDN

Note that this will loop until @@NESTLEVEL reaches 32

Upvotes: 2

Related Questions