{"id":448,"date":"2010-06-30T16:28:33","date_gmt":"2010-06-30T10:58:33","guid":{"rendered":"http:\/\/JitendraZaa.com\/blog\/?p=448"},"modified":"2010-06-30T16:28:33","modified_gmt":"2010-06-30T10:58:33","slug":"search-for-table-in-sql-server","status":"publish","type":"post","link":"https:\/\/www.jitendrazaa.com\/blog\/sql\/search-for-table-in-sql-server\/","title":{"rendered":"Search for Table in SQL Server"},"content":{"rendered":"<p>In\u00a0organization, where huge number of tables present in database. its very hard to search the particular table.<\/p>\n<p>Here few SQL queries to search the table name by pattern.<\/p>\n<p><strong>Search For Table whose name starts with A<\/strong><\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT DISTINCT &#x5B;Table] = OBJECT_NAME(OBJECT_ID)\nFROM SYS.INDEXES\nWHERE\nOBJECTPROPERTY(OBJECT_ID,'IsUserTable') = 1\nAND OBJECT_NAME(OBJECT_ID) like 'A%'\n<\/pre>\n<p><span style=\"font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal; font-size: 13px;\">Clustered Index speeds up performance of the query ran on that table. Clustered Index are usually Primary Key but not necessarily. I frequently run following query to verify that all the developers are creating all the tables with Clustered Index.<\/span><\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT DISTINCT &#x5B;Table] = OBJECT_NAME(OBJECT_ID)\nFROM SYS.INDEXES\nWHERE\nINDEX_ID = 0 AND\nOBJECTPROPERTY(OBJECT_ID,'IsUserTable') = 1\n<\/pre>\n<figure id=\"attachment_450\" aria-describedby=\"caption-attachment-450\" style=\"width: 177px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/06\/Non-clustered-Tables.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-450\" title=\"List of Non clustered Tables in SQL Server 2005\" src=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/06\/Non-clustered-Tables.png?resize=177%2C250&#038;ssl=1\" alt=\"List of Non clustered Tables in SQL Server 2005\" width=\"177\" height=\"250\" \/><\/a><figcaption id=\"caption-attachment-450\" class=\"wp-caption-text\">List of Non clustered Tables in SQL Server 2005<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In\u00a0organization, where huge number of tables present in database. its very hard to search the particular table. Here few SQL queries to search the table name by pattern. Search For Table whose name starts with A SELECT DISTINCT &#x5B;Table] = OBJECT_NAME(OBJECT_ID) FROM SYS.INDEXES WHERE OBJECTPROPERTY(OBJECT_ID,&#8217;IsUserTable&#8217;) = 1 AND OBJECT_NAME(OBJECT_ID) like &#8216;A%&#8217; Clustered Index speeds up [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"jz_research_post":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[13,14],"tags":[333,292],"class_list":["post-448","post","type-post","status-publish","format-standard","hentry","category-sql","category-sqlserver","tag-sql","tag-sql-server"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":504,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/drop-function-if-exist-sql-server\/","url_meta":{"origin":448,"position":0},"title":"Drop Function if exist &#8211; SQL Server","author":"Jitendra","date":"July 2, 2010","format":false,"excerpt":"Drop the user define function from database if it exists.","rel":"","context":"In &quot;SQL&quot;","block_context":{"text":"SQL","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5828,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/sqlserver\/sql-server-search-complete-database-for-value\/","url_meta":{"origin":448,"position":1},"title":"SQL Server \u2013 Search complete database for value","author":"Jitendra","date":"November 26, 2016","format":false,"excerpt":"Search complete Database in SQL Server for some value","rel":"","context":"In &quot;SQL Server&quot;","block_context":{"text":"SQL Server","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/sqlserver\/"},"img":{"alt_text":"SQL Server search database for value","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/11\/SQL-Server-search-database-for-value.png?fit=1108%2C429&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/11\/SQL-Server-search-database-for-value.png?fit=1108%2C429&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/11\/SQL-Server-search-database-for-value.png?fit=1108%2C429&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/11\/SQL-Server-search-database-for-value.png?fit=1108%2C429&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/11\/SQL-Server-search-database-for-value.png?fit=1108%2C429&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":454,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/drop-stored-procedure-if-exist-in-sql-server\/","url_meta":{"origin":448,"position":2},"title":"Drop Stored Procedure if exist in SQL Server","author":"Jitendra","date":"June 30, 2010","format":false,"excerpt":"How to drop the stored procedure in SQL Server if exist","rel":"","context":"In &quot;SQL&quot;","block_context":{"text":"SQL","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1125,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/sqlserver\/get-table-information-column-name-data-type-in-sql-server\/","url_meta":{"origin":448,"position":3},"title":"Get Table information (Column Name, Data Type) in SQL Server","author":"Jitendra","date":"September 18, 2010","format":false,"excerpt":"Get Table information like Column Name, Data Type, Character length, Default Values etc in SQL Server","rel":"","context":"In &quot;SQL Server&quot;","block_context":{"text":"SQL Server","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/sqlserver\/"},"img":{"alt_text":"SQL Server INFORMATION_SCHEMA.COLUMNS","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/09\/SQL-Server-INFORMATION_SCHEMA.COLUMNS-300x44.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1161,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/sqlserver\/sql-server-pivot-table-example\/","url_meta":{"origin":448,"position":4},"title":"SQL Server Pivot Table Example","author":"Jitendra","date":"September 29, 2010","format":false,"excerpt":"Example and tutorial of using PIVOT in SQL Server","rel":"","context":"In &quot;SQL Server&quot;","block_context":{"text":"SQL Server","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/sqlserver\/"},"img":{"alt_text":"SQL Server Pivot Table","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/09\/SQL-Server-Pivot-Table.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":829,"url":"https:\/\/www.jitendrazaa.com\/blog\/sql\/sqlserver\/convert-rows-into-comma-separated-values-column-sql-server\/","url_meta":{"origin":448,"position":5},"title":"Convert rows into comma separated values column &#8211; SQL Server","author":"Jitendra","date":"October 4, 2010","format":false,"excerpt":"Convert rows into comma separated values column - SQL Server","rel":"","context":"In &quot;SQL Server&quot;","block_context":{"text":"SQL Server","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/sql\/sqlserver\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/comments?post=448"}],"version-history":[{"count":0,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/448\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/media?parent=448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/categories?post=448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/tags?post=448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}