Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 277982

DDL UNIQUE constraints ensure that the data contained in a column, or a group of columns, is unique among all the rows in the table. The data contained in the column or columns involved is, therefore, useful to uniquely identify a row in the relevant table.

2 votes
3 answers
604 views

Are unique filtered indexes considered an antipattern for enforcing constraints?

I have a table, such as the following. Let's called it Fools. FoolID FoolValue IsActiveFoolValue 1 Ultra Foolish 0 1 Super Foolish 1 2 Quite Foolish 1 A business rule is that for each Fo …
J. Mini's user avatar
  • 855
1 vote
1 answer
95 views

Should unique filtered indexes include their filtering column?

Context Suppose that you have a unique filtered index on a table. Said index exists only to enforce a constraint. A classic example of such an index would be one making sure that a non-nullable bit co …
J. Mini's user avatar
  • 855
3 votes
2 answers
455 views

Is there any benefit to declaring an index that contains a primary key as unique?

Suppose that I have a table with many columns that I don't care about, but two that I do: Primary and Secondary. There is a clustered primary key on Primary. CREATE TABLE [dbo].[OnlyTwoGoodColumnsButM …
J. Mini's user avatar
  • 855