创建非主键唯一约束

USE ZrqCommon;
GO
ALTER TABLE UserInfo
ADD CONSTRAINT AK_UserName UNIQUE (UserName);
GO

原文地址:https://www.cnblogs.com/90nice/p/4701460.html