In SQL Server, INT
is a data type that stands for integer.
It is used to store whole numbers, both positive and negative, that range from -2,147,483,648 to 2,147,483,647.
INT
is commonly used to store numerical data such as ID numbers, counts, or monetary values that do not require decimal precision. The storage size for INT
data type is 4 bytes.
When creating a table, you can specify INT
as the data type for a column to indicate that the column will only store integers.
INT syntax
Range | Storage |
---|---|
-2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647) | 4 Bytes |
INT example
USE model;
GO
CREATE TABLE myIntTable ( b int );
GO
INSERT INTO myIntTable VALUES (214483647);
GO
SELECT b FROM myIntTable;
GO
Results |
---|
214483647 |
Summary: On Transact SQL language the INT
is an numeric data type. The INT
data type is the primary integer data type in SQL Server.