create table test
(
idx int not null
)
insert into test (idx) values (2);
create trigger testInsert on test
instead of insert
as
begin
declare @num int
set @num = (select idx from inserted)
declare @return int
set @return = 0
if not exists(select * from test where idx = @num)
begin
insert into test (idx) values (@num);
set @return = 1
end
print(@return)
end
select * from test
댓글 영역