Last active
August 2, 2025 15:40
-
-
Save r1d3rzz/0bdc0ce47b9e44a2b01f04556bac504c to your computer and use it in GitHub Desktop.
make unique row in mssql Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use DB | |
| go | |
| ALTER TABLE Tbl_SysUserIssueCategory | |
| ADD CONSTRAINT UQ_SysUser_IssueCategory UNIQUE (SysUserId, IssueCategoryId); | |
| remove | |
| ======= | |
| USE DB; | |
| GO | |
| ALTER TABLE Tbl_SysUserIssueCategory | |
| DROP CONSTRAINT UQ_SysUser_IssueCategory; | |
| check | |
| ========== | |
| SELECT | |
| name, | |
| type_desc | |
| FROM | |
| sys.objects | |
| WHERE | |
| parent_object_id = OBJECT_ID('Tbl_SysUserIssueCategory') | |
| AND type_desc LIKE '%CONSTRAINT%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment