SQLServer中给表增加组合唯一约束
将两个或者多个字段一起约束成一个唯一约束
ALTER TABLE Reg_User_Relationship ADD CONSTRAINT UC_UniqueValue UNIQUE (UserId,RUserId,RelationshipStatus)
当有重复的数据插入的时候
将两个或者多个字段一起约束成一个唯一约束
ALTER TABLE Reg_User_Relationship ADD CONSTRAINT UC_UniqueValue UNIQUE (UserId,RUserId,RelationshipStatus)
当有重复的数据插入的时候