DEV Community

Chris Richmond
Chris Richmond

Posted on

SQL Server GUID Identity

Problem:
You need to use unique identifiers in your SQL table instead of Ints.

Solution:
CREATE TABLE NEWID_TEST
(
ID UNIQUEIDENTIFIER DEFAULT NEWID() PRIMARY KEY,
etc etc
)
GO
CREATE TABLE NEWSEQUENTIALID_TEST
(
ID UNIQUEIDENTIFIER DEFAULT NEWSEQUENTIALID() PRIMARY KEY,
etc...
)
GO

Original Source

Top comments (0)