Using the uniqueidentifier field type for SQL Server

Source: Internet
Author: User
Tags uuid docker run

Original: uniqueidentifier field type using SQL Server

SQL Server has been introduced since version 2008?uniqueidentifier? field, which stores a UUID, or GUID, with an internal storage of 16 bytes. SQL Server can be generated by two functions?uniqueidentifier, respectively?NEWID()and?NEWSEQUENTIALID(), which can only be used as the default value for a field. Java also has a UUID tool class?java.uti.UUID,?UUID.randomUUID().toString()? generate a random UUID string, in the?java.util.UUID? It also uses two?longThe field represents the internal state.

SQL Server's? uniqueidentifier ? The Type field indicates how the interior is stored, and when we manipulate it, its external representation is a fixed format? xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ? A string that is not case-sensitive.

The SQL Server used in this article is version 2017, which starts with Docker.

Docker run-e ' accept_eula=y '-e ' sa_password=yourstrong (!) Password '-P 1433:1433-d microsoft/mssql-server-linux:2017-latest

Then we create a with a? uniqueidentifier ? A table of type fields? Read the full text >>

Using the uniqueidentifier field type for SQL Server

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.