create trigger triA on tablename instead of insert
as
begin
if not exists ( select * from tablename a join inserted b on a.主键=b.主键)
insert tablename select * form inserted
end
go
as
begin
if not exists ( select * from tablename a join inserted b on a.主键=b.主键)
insert tablename select * form inserted
end
go
CREATE UNIQUE INDEX IndexName ON TableName(Col01, Col02, Col03, ...) WITH IGNORE_DUP_KEY
在插入的时候, 无记录则插入, 有记录则插入.