WebApi接口防止表单重复提交终极解决方案

SQLServer中给表增加组合唯一约束

将两个或者多个字段一起约束成一个唯一约束

ALTER TABLE Reg_User_Relationship
ADD CONSTRAINT AK_Reg_User_Relationship UNIQUE (UserId,RUserId,RelationshipStatus)

当有重复的数据插入的时候

参考文献:https://www.w3school.com.cn/sql/sql_unique.asp

SQLServer - 约束:https://www.cnblogs.com/kissdodog/archive/2013/05/31/3109509.html

posted @ 2020-05-06 15:09  代码沉思者  阅读(2744)  评论(0编辑  收藏  举报