You plan to create a new table that has the following requirements:
Uses a GUID data type as the primary key.
Uses a clustered index as the primary key.
Minimizes fragmentation.
You need to recommend which option to include in the CREATE statement.
Which option should you include?
More than one answer choice may achieve the goal. Select the BEST answer.
A.
NEWID
B.
@@IDENTITY
C.
NEWSEQUENTIALID
D.
IDENTITY
Say you have a table called Lots Of Data with 1 million rows and you use NewID() to define a clustered primary key. If you insert 1 million new records into that table you don’t know where the rows will be put.The clustered index ensures that the rows will be inserted in order of the clustering key, but the NewID() function doesn’t provide predictable ordering.
However, if you use the NewSequentialId() function, you’ll know that the 1 million rows will be inserted in sequential order at the end of the table.