PrepAway - Latest Free Exam Questions & Answers

Which Transact-SQL statement should you use?

You are given a database design to evaluate. All of the tables in this database should have a clustered index.
You need to determine the tables that are missing a clustered index by using the system catalog views.
Which Transact-SQL statement should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
SELECT name AS table_name FROM sys.tables
WHERE OBJECTPROPERTY(object_id,’TableHasClustIndex’) = 0
ORDER BY name;

B.
SELECT name AS table_name
FROM sys.tables WHERE OBJECTPROPERTY(object_id,’TableHasUniqueCnst’) = 0 ORDER BY name;

C.
SELECT name AS table_name FROM sys.tables
WHERE OBJECTPROPERTY(object_id,’TableHasClustIndex’) = 0 AND
OBJECTPROPERTY(object_id,’TableHasUniqueCnst’) = 1 ORDER BY name;

D.
SELECT name AS table_name FROM sys.tables
WHERE OBJECTPROPERTY(object_id,’TableHasClustIndex’) = 1 AND OBJECTPROPERTY(object_id,’TableHasUniqueCnst’) = 1
ORDER BY name;


Leave a Reply