SQL Server characters commonly used segment type

Source: Internet
Author: User

Bit: integer, value range [0,1,null], for accessing Boolean values

Tinyint: integer, value range [0~256]

smallint: integer, value range [ -215~215]

int: integral type, range of values [ -231~231]

Decimal: Exact numeric type, example: Decimal (8,4); Total 8 digits, 4 digits to the right of the decimal point

Numeric: Similar to decimal

SmallMoney: Currency type

Money: Currency type

FLOAT: Approximate numerical type

Real: Approximate numerical type

smalldatetime: Date and Time type, representing the date and time from January 1, 1900 to June 6, 2079, accurate to one minute

DateTime: Date-time, from January 1, 1753 to December 31, 9999 all date and time data, accurate to 1% seconds or 3.33 milliseconds

Cursor: A special data type that contains a reference to a cursor. Used in stored procedures, cannot be used when creating tables

Timestamp: Special data type, used to create a database-wide unique digital, a table can only have one timestamp column, each time you insert or modify a row, the value of the timestamp column will change.

uniqueidentifier: A special data type that stores a globally unique identifier, the GUID

Char: Character type, storing fixed-length, non-uniform encoded data of specified lengths, column widths must be specified, and column widths up to 8,000 characters

varchar: Character type, store non-uniform encoded character data, data type is variable length, to specify the maximum length of the column, the length of storage is not column length, but the length of the data

Text: Character type, storing a large number of non-uniform encoded character data

NCHAR: Unified coded character type, storing fixed length unified encoded character data, can store 4000 characters, unified encoding with double-byte structure to store each character

Nvarchar: Unified coded character type, used as a uniformly encoded character data with variable length

NTEXT: Uniform encoded character type for storing large numbers of uniformly encoded character data

Binary: Binary data type that stores fixed-length binary data up to 8000 bytes long

VARBINARY: Binary data type for storing variable-length binary data up to 8000 bytes long

Image: Binary data type, used to store variable-length binary data

SQL Server characters commonly used segment 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.