sp_configure 'nested triggers',1
alter database pubs
set RECURSIVE_TRIGGERS ON
create table abcd (recid int)
create trigger abcd_trigger
instead of insert
declare @recid int
select @recid = recid + 1 from inserted
insert into abcd values (@recid)
insert into abcd values (1)
select * from abcd
drop trigger abcd_trigger
drop table abcd
Why does this insert value as 2 even though I have enabled recursive triggers.... Gurus .. any answers????
And as for changing the database options ... please check what they are before executing this post so that you can reset them later.