Skip to content

identity-generated-by-default (CT003)#

Automatic fix is available.

What it does#

Checks for identity generated by default.

Why not?#

GENERATED BY DEFAULT allows you to specify a value for insert or update on an identity column instead of system generated value. This is usually not what you want for an identity column.

When should you?#

If you want to be able to specify a value for insert or update on an identity column instead of system generated value.

Use instead:#

GENERATED ALWAYS