TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mitesh Patel
1.5k
201
141.2k
NEWID() vs NEWSEQUENTIALID()
Aug 3 2018 12:43 PM
NEWID() generates the GUID in random order .
NEWSEQUENTIALID() which generates the GUID in sequential order.
Newsequentialid() creates a GUID greater than the previous one, since windows was started. If windows has been restarted the GUID may begin at a lower range (still unique however).
For best performance of inserts use newsequentialid().
NEWSEQUENTIALID is able to completely fill data and index pages.
Newid() you can use in a select, newsequentialid() you cant.
If you are worried about, or have a need for privacy don’t use sequential GUIDs
NEWID() is RFC4122 compliant.
CREATE TABLE SeQGUID_Example
(
SeqColumn uniqueidentifier DEFAULT NewSequentialID()
,IDColumn uniqueidentifier DEFAULT NEWID(),)
----Inserting five default values in table
INSERT INTO SeQGUID_Example DEFAULT
VALUES
INSERT INTO SeQGUID_Example DEFAULT
VALUES
INSERT INTO SeQGUID_Example DEFAULT
VALUES
INSERT INTO SeQGUID_Example DEFAULT
VALUES
---------------------------------------------------------
SELECT *
FROM SeQGUID_Example
----Clean up database
DROP TABLE SeQGUID_Example
Reply
Answers (
1
)
The Changed value in this cell was not recognized as valid.
How to calculate Total exam and display grade