Use of guid

Source: Internet
Author: User

In the early stage, I found some information on the Internet to solve the unique order number problem. Someone suggested using the guid type.

View the description in msdn as follows:

The GUID type indicates a 16-byte (128-bit) guid value. This type is mapped to the uniqueidentifier type in SQL Server.

According to this description, The GUID is stored as the uniqueidentifier type in the database. The GUID value is obtained based on the unique number of computer NICs identified by a CPU clock. The NIC manufacturer can guarantee the uniqueness of the NIC at least within the next month.

Guid generation. The default value is automatically generated in the database:

Create Table [order] (uniquecolumn uniqueidentifier default newid (), characters varchar (10 ))

 

C # generate the guid value. C # a guid structure and a static method newguid () can be used to create a guid instance. The details are as follows:

Guid. newguid ();

 

 

 

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.