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