SQL Server Data type

Source: Internet
Author: User

Character string:

char (n) string with a fixed-length string of up to 8,000 characters.

varchar (n) variable-length string with a maximum of 8,000 characters.

VARCHAR (max) variable-length string with a maximum of 1,073,741,824 characters.

text, variable length, up to 2GB character data.

Unicode string:

NCHAR (n) string, fixed-length string with a maximum of 4,000 characters.

nvarchar (n) variable-length string with a maximum of 4,000 characters.

nvarchar (max) variable-length string with a maximum of 536,870,912 characters.

ntext, variable length, up to 2GB character data.

Binary Type:

Bit, allows 0,1,null.

Image, storing images as binary data, up to 2GB.

Number type:

Thinyint, all numbers from 0 to 255.

int integer that allows all numbers from 2,147,483,648 to 2,147,483,647.

smallint, allows all numbers from 3276 to 3276.

BigInt, allows all numbers from 9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

Decimal (limit the number of decimal digits) to store the exact value.

float (), floating precision digital data from -1.79e + 308 to 1.79E + 308. The parameter n indicates whether the field holds 4 bytes or 8 bytes.

Float (24) holds 4 bytes, while float (53) holds 8 bytes. The default value for N is 53.

Money, a monetary data between -922,337,203,685,477.5808 and 922,337,203,685,477.5807.

RelA, floating precision digital data from -3.40e + 38 to 3.40E + 38.

Date Type:

DateTime, from January 1, 1753 to December 31, 9999, with a precision of 3.33 milliseconds.

datetime2, from January 1, 1753 to December 31, 9999, the accuracy is 100 nanoseconds.

smalldatetime, from January 1, 1900 to June 6, 2079, has a precision of 1 minutes.

Date, which stores dates only, from January 1, 01 to December 31, 9999.

Time, which is only stored for 100 nanoseconds.

Timestamp, stores a unique number that is updated whenever a row is created or modified.

The timestamp is based on the internal clock and does not correspond to real time. There can be only one timestamp variable per table.

SQL Server Data type

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.