Uniqueidentifier data type in SQL Server

Source: Internet
Author: User

the uniqueidentifier data type can store 16-byte binary values, which act the same as the Globally Unique Identifier (guid. GUID is the unique binary number: No duplicate guid value is generated on any two computers in the world.

in SQL, rowguidcol indicates that the new column is the Globally Unique Identifier column of the row. Only one uniqueidentifier column can be assigned to each table as the rowguidco column. The rowguidcol attribute can only be assigned to the uniqueidentifier column

uniqueidentifier:

1. use the newid () function to implement

2. directly convert the constant of the string to XXXXXXXX-XXXX-xxxxxxxxxxxx

example: 6f9619ff-8b86-d011-b42d-00c04fc964ff

3. directly assign 32-bit sixteen-Bit Data

example: 0xffffffffff00000000ffffffff00000000

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.