MSSQL Data type

Source: Internet
Author: User
Tags mssql

Data type true number

bigint integer data (all numbers) from -2^63 (-9223372036854775808) to 2^63-1 (9223372036854775807).

int from -2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647) for integer data (all numbers).

smallint integer data from -2^15 (-32,768) to 2^15-1 (32,767).

tinyint integer data from 0 to 255.

Bit 1 or 0 of integer data.

With decimals

Decimal numeric data from -10^38 +1 to 10^38–1 for fixed precision and decimal digits.

Numeric is functionally equivalent to decimal.

Currency or Money

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

The smallmoney currency data value is between -214,748.3648 and +214,748.3647 and is accurate to 10 per thousand of the currency unit.

Floating point number

Float precision number from -1.79e + 308 to 1.79E + 308.

Real floating-point precision numbers from -3.40e + 38 to 3.40E + 38.

Time

DateTime date and time data from January 1, 1753 to December 31, 9999, accurate to 3% seconds (or 3.33 milliseconds).

smalldatetime date and time data from January 1, 1900 to June 6, 2079, accurate to minutes.

String

Char fixed-length non-Unicode character data with a maximum length of 8,000 characters.

varchar variable-length non-Unicode data with a maximum of 8,000 characters.

Text variable-length non-Unicode data with a maximum length of 2^31-1 (2,147,483,647) characters.
ntext variable-length Unicode data with a maximum length of 2^30-1 (1,073,741,823) characters.

NChar fixed-length Unicode data with a maximum length of 4,000 characters.

Nvarchar variable-length Unicode data with a maximum length of 4,000 characters. sysname is a system-supplied user-defined data type that is functionally equivalent to nvarchar (128) for referencing database object names.

Binary string

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

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

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

Other data types

A reference to the cursor cursor.

Sql_variant a data type that stores values for various data types supported by SQL Server (except text, ntext, timestamp, and sql_variant).

Table A special data type that stores the result set for later processing.

A unique number that timestamp the database scope, and is updated each time the row is updated.

uniqueidentifier the globally unique identifier (GUID).

About saving Chinese characters

Example:

varchar (4) You can enter 4 letters or two characters
nvarchar (4) can lose four characters, can also lose 4 letters, but a maximum of four

MSSQL Data type

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.