Query to find non indexed table in sql server

By
Advertisement

Introduction:

In this article I am going to explain about the query used to get the table with clustered index or primary key in sql server.

Explanation:

Indexed table will boost the performance of a query by reducing the query cost. So it is necessary to fid out the tables without the clustered index or primary key. Below query is used to get the tables in a data base without clustered index or primary key


SQL Query:

SELECT DISTINCT [TABLE] = OBJECT_NAME(OBJECT_ID)
FROM SYS.INDEXES
WHERE INDEX_ID = 0
AND OBJECTPROPERTY(OBJECT_ID,'IsUserTable') = 1
ORDER BY [TABLE]

So if you want to make your query to run faster then findout the tables without clustered index or primary key and create the index.

To create the index to tables checkout our article <article name>

Do you like this article. Then comment here or share with your friends. Or like our facebook page.

0 comments:

Post a Comment

Online Casino