PrepAway - Latest Free Exam Questions & Answers

You are designing a table for a SQL Server database. The table uses horizontal partitioning.

You are designing

a table for a SQL Server database. The table uses horizontal partitioning.

You have the following requirements:

Each record in the table requires a unique key.

You must minimize table fragmentation as the table grows.

You need to choose the appropriate

data type for the key value.

What should you do?

A. Use the NEWID function to create a unique identifier.

B. Use the NEWSEQUENTIALID function to create a unique identifier.

C. Generate a random value that uses the bigint datatype.

D. Generate a random va

lue that uses the char(16) data type.

Explanation:

Horizontal partitioning divides a table into multiple tables. Each table then contains the same number of columns, but fewer rows. For example, a table that contains 1 billion rows could be part

itioned horizontally into 12 tables, with each smaller table representing one month of data for a specific year. Any queries requiring data for a specific month only reference the appropriate table.

NEWSEQUENTIALID creates a GUID that is greater than any G

UID previously generated by this function on a specified computer since Windows was started. After restarting Windows, the GUID can start again from a lower range, but is still globally unique. When a GUID column is used as a row identifier, using NEWSEQUE

NTIALID can be faster than using the NEWID function. This is because the NEWID function causes random activity and uses fewer cached data pages. Using NEWSEQUENTIALID also helps to completely fill the data and index pages.

References:https://msdn.microsof

t.com/en-us/library/ms189786.aspx


Leave a Reply