{"id":2480,"date":"2015-07-25T19:50:36","date_gmt":"2015-07-25T19:50:36","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=2480"},"modified":"2015-07-25T19:50:36","modified_gmt":"2015-07-25T19:50:36","slug":"finding-the-number-of-rows-of-all-tables-in-a-sql-server-database","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/finding-the-number-of-rows-of-all-tables-in-a-sql-server-database\/","title":{"rendered":"Finding the number of rows of all tables in a SQL Server database"},"content":{"rendered":"<p>The following query finds all tables in a schema, ordered by row count:<\/p>\n<pre lang=\"sql\">\nSELECT\n    sysobjects.*\n    , sysindexes.Rows\nFROM\n    sysobjects\n    INNER JOIN sysindexes\n    ON sysobjects.id = sysindexes.id\nWHERE\n    type = 'U'\n    AND sysindexes.IndId < 2\nORDER BY sysindexes.Rows desc\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The following query finds all tables in a schema, ordered by row count: SELECT sysobjects.* , sysindexes.Rows FROM sysobjects INNER JOIN sysindexes ON sysobjects.id = sysindexes.id WHERE type = &#8216;U&#8217; AND sysindexes.IndId < 2 ORDER BY sysindexes.Rows desc\n<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4,7],"tags":[160,524],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/2480"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=2480"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/2480\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=2480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=2480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=2480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}