Find tables without Indexes


Sometimes we need to analyze the performance of the query the first things comes in our mind is Index, the following query can be used to find those tables who don't have the indexes.

Run the following query
USE <your_database_name>; 
GO
SELECT SCHEMA_NAME(schema_id) AS schema_name,name AS tbl_name
FROM sys.tables
WHERE OBJECTPROPERTY(OBJECT_ID,'IsIndexed') = 0
ORDER BY schema_name, tbl_name;
GO

No comments:

Post a Comment

Please do not enter any spam link in the comment box.

Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...