Identityit depends on the data type of the column, and will be within the capabilities of that data type.
It can be, therefore:
TIPO DATO MIN MAX VALUE
TinyInt 0 255
SmallInt -2^15 (-32,768) 2^15-1 (32,767)
Int -2^31 (-2,147,483,648) 2^31-1 (2,147,483,647)
BigInt -2^63 (-9,223,372,036,854,775,808) 2^63-1 (9,223,372,036,854,775,807)
Decimal -10^38-1 10^38
A type field IDENTITYin SQL Server; can have any of the following types
INT
BIGINT
TINYINT
DECIMAL
Note: If you use decimal, your statement should be of this type DECIMAL(3, 0)
FOR it to be valid
The SQL Server console can actually return a message like this where it tells you what data types are valid
Identity column 'id' must be of data type int, bigint, smallint, tinyint, or decimal or numeric with a scale of 0, unencrypted, and constrained to be nonnullable.
Given the above, then
INT Has a length of: -231 (-2,147,483,648) to 231-1 (2,147,483,647)
and from there you can choose the one you want
BIGINT Has a capacity of:-2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807)
Identity
it depends on the data type of the column, and will be within the capabilities of that data type.It can be, therefore:
You can see it in action, with something like:
A type field
IDENTITY
in SQL Server; can have any of the following typesNote: If you use decimal, your statement should be of this type
DECIMAL(3, 0)
FOR it to be validThe SQL Server console can actually return a message like this where it tells you what data types are valid
Given the above, then
INT Has a length of:
-231 (-2,147,483,648) to 231-1 (2,147,483,647)
and from there you can choose the one you wantBIGINT Has a capacity of:
-2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807)