MSSQL字段组合约束唯一性防止数据重复

​10线程同时操作,频繁出现插入同样数据的问题。虽然在插入数据的时候使用了: insert inti tablename(fields....) select @t1,@t2,@t3 from tablename where not exists (select id from tablename where t1=@t1,t2=@t2,t3=@t3) 当时还是在高并发的情况下无效。此语句也包含在存储过程中。

MSSQL 数据重复