Which TransactSQL 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 TransactSQL
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 TransactSQL
statement should you use?

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 0

Your email address will not be published. Required fields are marked *