{"id":9456,"date":"2024-02-12T06:45:00","date_gmt":"2024-02-12T05:45:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=9456"},"modified":"2024-02-29T16:13:10","modified_gmt":"2024-02-29T15:13:10","slug":"how-to-get-the-list-of-all-tables-in-sql-server","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/","title":{"rendered":"How To Get the List of All Tables in SQL Server ?"},"content":{"rendered":"\n<p>To audit a MSSQL database and its tables, it is common to want the list of tables in the form of a table or an Excel spreadsheet. This SQL query allows you to list all the tables in a SQL Server database and display the number of rows and size for each table. SQL Server developers also often look for tables, for example for impact analysis. Hence it is very useful to quickly list all the tables for an audit for example, whether it is technical or functional. To begin with, these three different T-SQL queries allow you to display the information in different ways, and with different levels of details.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The first is a simple list of tables. <\/li>\n\n\n\n<li>Second query displays useful information such as the object_id column, create_date and modify_date. <\/li>\n\n\n\n<li>The third query displays the schema, the number of rows and the disk space used by each table.<\/li>\n<\/ol>\n\n\n\n<p>Indeed, the SQL Server system tables and system views contain useful <a href=\"https:\/\/www.parse.ly\/glossary\/metadata\/\" target=\"_blank\" rel=\"noreferrer noopener\">metadata that describes the different objects<\/a> in the database, including the tables of course. Thus, all the solutions presented in this article use system tables or views, such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>information_schema.tables<\/li>\n\n\n\n<li>sys.tables<\/li>\n\n\n\n<li>sys.indexes<\/li>\n\n\n\n<li>sys.partitions<\/li>\n\n\n\n<li>sys.allocation_units<\/li>\n\n\n\n<li>or sys.schemas<\/li>\n<\/ul>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#1-display-a-list-of-all-tables-using-one-sql-server-system-table\" >1. Display a list of all tables using one SQL Server system table<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#2-query-to-get-the-list-of-sql-server-tables-using-systables-view\" >2. Query to get the list of SQL Server tables using sys.tables view<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#3-display-the-list-of-table-names-and-sizes-in-t-sql\" >3. Display the list of table names and sizes in T-SQL<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1-display-a-list-of-all-tables-using-one-sql-server-system-table\"><\/span>1. Display a list of all tables using one SQL Server system table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>In SQL Server, information_schema.table is a view, not a table. <\/strong>It is one of the INFORMATION_SCHEMA views standardised by ISO for relational database management systems (RDBMS). This view provides information about the tables and views present in a database. You can consult it to obtain metadata on these tables and views, such as their names, types (table or view), and other details. For example, you can use the system table information_schema.table, like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT *\nFROM   information_schema.tables\nWHERE  table_type='BASE TABLE';\n<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"560\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2024\/02\/T-SQL-list-all-tables-in-sql-server-database.jpg\" alt=\"Query to get the list of all tables in SQL Server\" class=\"wp-image-30285\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2024\/02\/T-SQL-list-all-tables-in-sql-server-database.jpg 600w, https:\/\/expert-only.com\/wp-content\/uploads\/2024\/02\/T-SQL-list-all-tables-in-sql-server-database-300x280.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption class=\"wp-element-caption\"><em>Query to get the list of all tables in SQL Server<\/em><\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2-query-to-get-the-list-of-sql-server-tables-using-systables-view\"><\/span>2. Query to get the list of SQL Server tables using sys.tables view<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can also use the sys.tables system table. The result of the query shows that the table type stored in the [type_desc] column is USER_TABLE. <strong>Sys.tables in Transact-SQL is also a system view and not a table.<\/strong> It is part of the SQL Server system catalogue and provides information on all the user tables and system tables that exist in the current database. It can be used to retrieve various details and metadata about tables, such as their name, creation date, modification date and so on. Although it can be queried as a table, do not treat it as an editable user table. Instead, it is a structured view that presents certain system metadata about the tables.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT *\nFROM   sys.tables;\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3-display-the-list-of-table-names-and-sizes-in-t-sql\"><\/span>3. Display the list of table names and sizes in T-SQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The third one is to use multiple SQL Server <a href=\"https:\/\/www.collinsdictionary.com\/dictionary\/english\/system\" target=\"_blank\" rel=\"noreferrer noopener\">system<\/a> tables such as sys.tables, sys.indexes, sys.partitions, sys.allocation_units and sys.schemas. These tables are useful for displaying the list of tables. They are also used to display the number of rows in each table and the disk space used. For example, this query displays all tables with their number of rows sorted in descending order. This query is useful to find the size of the largest tables in a SQL Server database.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT\nsch.name AS SCHEMANAME,\ntab.name AS TABLENAME,\npar.rows AS ROWCOUNTS,\nSUM(alc.total_pages) * 8 AS TOTAL_SPACE,\nSUM(alc.used_pages) * 8 AS USED_SPACE,\n(SUM(alc.total_pages) - SUM(alc.used_pages)) * 8 AS UNUSED_SPACE\nFROM sys.tables tabSELECT\n\tsch.name AS SCHEMANAME,\n\ttab.name AS TABLENAME,\n\tpar.rows AS ROWCOUNTS,\n\tSUM(alc.total_pages) * 8 AS TOTAL_SPACE,\n\tSUM(alc.used_pages) * 8 AS USED_SPACE,\n\t(SUM(alc.total_pages) - SUM(alc.used_pages)) * 8 AS UNUSED_SPACE\nFROM sys.tables tab\n\tINNER JOIN sys.indexes ind\n\t\tON tab.object_id = ind.object_id\n\tINNER JOIN sys.partitions par\n\t\tON  ind.object_id = par.object_id\n\t\tAND ind.index_id = par.index_id\n\tINNER JOIN sys.allocation_units alc\n\t\tON par.partition_id = alc.container_id\n\tLEFT OUTER JOIN sys.schemas sch\n\t\tON tab.schema_id = sch.schema_id\nGROUP BY \ttab.name, \n\t\tsch.name, \n\t\tpar.rows\nORDER BY par.rows DESC;\n<\/pre>\n\n\n\n<p>This list of bullets points explains the query above and how it is build.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The keyword &#8220;ORDER BY par.rows DESC;&#8221; is used to sort the list of SQL Server tables by their number of rows, in a descending order.<\/li>\n\n\n\n<li>To sort by schema and then by table name, use &#8220;ORDER BY 1,2&#8221; or &#8220;ORDER BY sch.name, tab.name; &#8221; instead. <\/li>\n\n\n\n<li>The size of the tables is noted in KiloBytes or KB.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-about-sql-server-object-listing-and-system-tables\">About SQL Server object listing and system tables <\/h3>\n\n\n\n<p>This technical MS SQL Server tutorial explains how to create and use a query to list all tables in a given database. If you are still new to SQL Server and want to create a table, here is <a href=\"https:\/\/expert-only.com\/en\/mysql\/create-table-mysql\/a\">how to create a SQL Server table<\/a> and insert a few rows of data. It is possible to display another <a href=\"https:\/\/expert-only.com\/en\/t-sql\/sql-server-table-size-disk-space\/\">list of MS SQL tables with more focus on disk space available<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-sql-and-it-tutorials wp-block-embed-sql-and-it-tutorials\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/expert-only.com\/en\/t-sql\/sql-server-table-size-disk-space\/\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>To audit a MSSQL database and its tables, it is common to want the list of tables in the form of a table or an Excel spreadsheet. This SQL query allows you to list all the tables in a <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/\" title=\"How To Get the List of All Tables in SQL Server ?\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":5789,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[454],"tags":[],"class_list":{"0":"post-9456","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-t-sql"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Get the List of All Tables in SQL Server ? T-SQL<\/title>\n<meta name=\"description\" content=\"SQL Server query to list all the tables in a database and display attributes like the number of rows and size for each table.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Get the List of All Tables in SQL Server ?\" \/>\n<meta property=\"og:description\" content=\"SQL Server query to list all the tables in a database and display attributes like the number of rows and size for each table.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-12T05:45:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-29T15:13:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/pattern_dark_texture-design-9D617D2FB8C_1920x1080.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"How To Get the List of All Tables in SQL Server ?\",\"datePublished\":\"2024-02-12T05:45:00+00:00\",\"dateModified\":\"2024-02-29T15:13:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/\"},\"wordCount\":705,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/pattern_dark_texture-design-9D617D2FB8C_1920x1080.jpeg\",\"articleSection\":[\"T-SQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/\",\"url\":\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/\",\"name\":\"How To Get the List of All Tables in SQL Server ? T-SQL\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/pattern_dark_texture-design-9D617D2FB8C_1920x1080.jpeg\",\"datePublished\":\"2024-02-12T05:45:00+00:00\",\"dateModified\":\"2024-02-29T15:13:10+00:00\",\"description\":\"SQL Server query to list all the tables in a database and display attributes like the number of rows and size for each table.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/pattern_dark_texture-design-9D617D2FB8C_1920x1080.jpeg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/pattern_dark_texture-design-9D617D2FB8C_1920x1080.jpeg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Get the List of All Tables in SQL Server ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/expert-only.com\/en\/#website\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"name\":\"SQL and IT Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/expert-only.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/expert-only.com\/en\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\",\"https:\/\/x.com\/expert_only\",\"https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How To Get the List of All Tables in SQL Server ? T-SQL","description":"SQL Server query to list all the tables in a database and display attributes like the number of rows and size for each table.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/","og_locale":"en_US","og_type":"article","og_title":"How To Get the List of All Tables in SQL Server ?","og_description":"SQL Server query to list all the tables in a database and display attributes like the number of rows and size for each table.","og_url":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2024-02-12T05:45:00+00:00","article_modified_time":"2024-02-29T15:13:10+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/pattern_dark_texture-design-9D617D2FB8C_1920x1080.jpeg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"How To Get the List of All Tables in SQL Server ?","datePublished":"2024-02-12T05:45:00+00:00","dateModified":"2024-02-29T15:13:10+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/"},"wordCount":705,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/pattern_dark_texture-design-9D617D2FB8C_1920x1080.jpeg","articleSection":["T-SQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/","url":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/","name":"How To Get the List of All Tables in SQL Server ? T-SQL","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/pattern_dark_texture-design-9D617D2FB8C_1920x1080.jpeg","datePublished":"2024-02-12T05:45:00+00:00","dateModified":"2024-02-29T15:13:10+00:00","description":"SQL Server query to list all the tables in a database and display attributes like the number of rows and size for each table.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/pattern_dark_texture-design-9D617D2FB8C_1920x1080.jpeg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/08\/pattern_dark_texture-design-9D617D2FB8C_1920x1080.jpeg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/t-sql\/how-to-get-the-list-of-all-tables-in-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"How To Get the List of All Tables in SQL Server ?"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL and IT Tutorials","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","caption":"Expert-Only"}}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/9456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=9456"}],"version-history":[{"count":8,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/9456\/revisions"}],"predecessor-version":[{"id":30301,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/9456\/revisions\/30301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/5789"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=9456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=9456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=9456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}