Although int is still the primary integer data type in SQL Server 2000, SQL Server 2000 is a new addition to the integer data type bigint, which applies to situations where integers exceed the int data range.
The int data type represents a range of values from -2^31 to 2^31-1, that is, you can use INT data types to express integers between 2,147,483,648 and 2,147,483,647 (that is, about 2 billion). An int consumes four bytes of storage space.
The bigint can accurately represent integers from -2^63 to 2^63-1 (that is, from 9,223,372,036,854,775,808 to 9,223,372,036,854,775,807), which occupies eight bytes of storage space.
When you use bigint, you need to pay attention to the following points:
In a data type precedence table, the bigint data type is positioned above the int, under SmallMoney.
SQL Server cannot automatically convert int data to bigint type.
If a function's argument expression is a bigint type, the function can only return data of type bigint. Functions that use the bigint data type are AVG, CEILING, FLOOR, MAX, MIN, round, sum, and so on.
You can use the bigint data type in all syntactic locations where integer data is specified: Alter PROCEDURE, ALTER TABLE, create PROCEDURE, create TABLE, and declare variables.
You can get the bigint column information in the SQL Server directory component (catalog components)
You may wonder why anyone might need to use the bigint data type. In fact, this question is not difficult to answer, for example, when your database needs to do large data operations (such as the credit card companies often encounter this situation), you need to use the bigint data type.