{"id":90,"date":"2011-03-01T12:22:09","date_gmt":"2011-03-01T19:22:09","guid":{"rendered":"http:\/\/www.sqldbpros.com\/?p=90"},"modified":"2011-03-01T12:23:01","modified_gmt":"2011-03-01T19:23:01","slug":"find-tables-without-clustered-indexes","status":"publish","type":"post","link":"http:\/\/sqldbpros.com\/wordpress\/2011\/03\/find-tables-without-clustered-indexes\/","title":{"rendered":"Find Tables Without Clustered Indexes"},"content":{"rendered":"<p>Need a way to find all tables without a clustered index in SQL Server? Running this script every once in awhile will help ensure best practices are being followed and every table has a clustered index. This script is compatible with SQL Server 2005 and SQL Server 2008.<!--more--><\/p>\n<blockquote><p>--Tables without a clustered index<br \/>\nSELECT DISTINCT<br \/>\nOBJECT_SCHEMA_NAME(object_id) AS SchemaName,<br \/>\nOBJECT_NAME(OBJECT_ID) AS\u00a0 TableName<br \/>\nFROM<br \/>\nSYS.INDEXES<br \/>\nWHERE<br \/>\nINDEX_ID = 0<br \/>\nAND OBJECTPROPERTY(OBJECT_ID, 'IsUserTable') = 1<br \/>\nORDER BY<br \/>\nOBJECT_SCHEMA_NAME(object_id),<br \/>\nOBJECT_NAME(OBJECT_ID)<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Need a way to find all tables without a clustered index in SQL Server? Running this script every once in awhile will help ensure best practices are being followed and every table has a clustered index. This script is compatible with SQL Server 2005 and SQL Server 2008.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,3],"tags":[13,10,4,6,9,12,11],"class_list":["post-90","post","type-post","status-publish","format-standard","hentry","category-performance-tuning","category-scripts","tag-indexes","tag-ms-sql","tag-performance","tag-script","tag-sql-server","tag-sql-server-2005","tag-sql-server-2008"],"_links":{"self":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":3,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts\/90\/revisions"}],"predecessor-version":[{"id":93,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts\/90\/revisions\/93"}],"wp:attachment":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/media?parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/categories?post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/tags?post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}