D
D
dienerie2022-04-04 16:55:33
SQL Server
dienerie, 2022-04-04 16:55:33

How to generate GUID in MS SQL?

How much understood, it is possible with the help of data type uniqueidentifier
But how to make, as an auto increment?
I didn’t quite understand.. I set it up, entered the test string, but the id is not generated..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2022-04-04
@dienerie

CREATE TABLE TestGUID	(
  ID UNIQUEIDENTIFIER NOT NULL PRIMARY KEY DEFAULT NEWID(),
  Name VARCHAR (50) NOT NULL )

Documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question