Difference Between NEWSEQUENTIALID() and NEWID() - SQL Server
both generates the GUID of datatype of uniqueidentifier NEWID() generates the GUID in random order whereas NEWSEQUENTIALID() generates the GUID in sequential order
Example:-
Example:-
----Create Test Table for with default columns values
CREATE TABLE temptable
(Column1 uniqueidentifier DEFAULT NEWID(),
Column2 uniqueidentifier DEFAULT NewSequentialID())
----Inserting five default values in table
INSERT INTO
temptable DEFAULT
VALUES
INSERT INTO
temptable DEFAULT
VALUES
INSERT INTO
temptable DEFAULT
VALUES
INSERT INTO
temptable DEFAULT
VALUES
INSERT INTO
temptable DEFAULT
VALUES
SELECT * FROM
temptable
Comments
Post a Comment