Table variables and row estimates

data-types
#tsql#data-types

A constraint that enforces entity integrity for a given column or columns through a unique

index. Only one

constraint can be created per table.

A constraint that provides entity integrity for a given column or columns through a unique

index. A table can have multiple

constraints.

Indicate that a clustered or a nonclustered index is created for the

or

constraint.

constraints use

, and

constraints use.

can be specified for only one constraint. If

is specified for a

constraint and a

constraint is also specified, the

uses.

A constraint that enforces domain integrity by limiting the possible values that can be entered

into a column or columns.

logical_expression

A logical expression that returns

or.

Specifies one or more index options. Indexes can’t be created explicitly on table variables, and

no statistics are kept on table variables. SQL Server 2014 (12.x) introduced syntax that allows

you to create certain index types inline with the table definition. Using this syntax, you can

create indexes on table variables as part of the table definition. In some cases, performance

might improve by using temporary tables instead, which provide full index support and

statistics.

For a complete description of these options, see

CREATE TABLE.

PRIMARY KEY

UNIQUE

PRIMARY KEY

UNIQUE

PRIMARY KEY

CLUSTERED

UNIQUE

NONCLUSTERED

CLUSTERED

CLUSTERED

UNIQUE

PRIMARY KEY
PRIMARY KEY

NONCLUSTERED

TRUE

FALSE