Microsoft®SQL Server™Summary of Common Data Types

Source: Internet
Author: User

Exact numeric integer

Bigint

Integer Data from-2 ^ 63 (-9223372036854775808) to 2 ^ 63-1 (9223372036854775807) (All numbers ).

Int

Integer Data from-2 ^ 31 (-2,147,483,648) to 2 ^ 31-1 (2,147,483,647) (All numbers ).

Smallint

Integer Data from-2 ^ 15 (-32,768) to 2 ^ 15-1 (32,767.

Tinyint

Integer Data from 0 to 255.

Bit

Bit

Integer Data of 1 or 0.

Decimal and numeric

Decimal

Number of fixed precision and decimal places from-10 ^ 38 + 1 to 10 ^ 38-1.

Numeric

Functions are equivalentDecimal.

Money and smallmoney

Money

The value of the currency data is between-2 ^ 63 (-922,337,203,685,477.5808) and 2 ^ 63-1 (+ 922,337,203,685,477.5807), accurate to 10 thousandth of the currency unit.

Smallmoney

The value of the currency data is between-214,748.3648 and + 214,748.3647, precise to the tenth of the monetary unit.

Approximate Number

Float

Floating Point precision numbers from-1.79e + 308 to 1.79e + 308.

Real

A floating point number ranging from-3.40e + 38 to 3.40e + 38.

Datetime and smalldatetime

Datetime

From the date and time of January 1, 3% to 3.33 seconds (or milliseconds ).

Smalldatetime

The date and time data from January 1, January 1-20, 1900 to January 1, June 6 are accurate to minutes.

String

Char

A fixed length of non-Unicode characters. The maximum length is 8,000 characters.

Varchar

Variable-length non-Unicode data, which can contain a maximum of 8,000 characters.

Text

Variable-length non-Unicode data. The maximum length is 2 ^ 31-1 (2,147,483,647) characters.

Unicode string

Nchar

Unicode data of a fixed length. The maximum length is 4,000 characters.

Nvarchar

A variable-length Unicode data with a maximum length of 4,000 characters.SysnameIs a user-defined data type provided by the system, which is functionally equivalentNvarchar (128)Used to reference the database object name.

Ntext

Unicode data with a variable length. The maximum length is 2 ^ 30-1 (1,073,741,823) characters.

Binary string

Binary

A fixed-length binary data with a maximum length of 8,000 bytes.

Varbinary

A variable-length binary data with a maximum length of 8,000 bytes.

Image

A variable-length binary data with a maximum length of 2 ^ 31-1 (2,147,483,647) bytes.

Other data types

Cursor

Cursor reference.

SQL _variant

A data type that stores data supported by SQL Server (Text,Ntext,TimestampAndSQL _variantThe data type of the value.

Table

A special data type that stores post-processing result sets.

Timestamp

The unique number in the database range, which is also updated each time the row is updated.

Uniqueidentifier

Guid ).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.