<legend id='axfnY'><style id='axfnY'><dir id='axfnY'><q id='axfnY'></q></dir></style></legend>
  • <small id='axfnY'></small><noframes id='axfnY'>

    • <bdo id='axfnY'></bdo><ul id='axfnY'></ul>

    <i id='axfnY'><tr id='axfnY'><dt id='axfnY'><q id='axfnY'><span id='axfnY'><b id='axfnY'><form id='axfnY'><ins id='axfnY'></ins><ul id='axfnY'></ul><sub id='axfnY'></sub></form><legend id='axfnY'></legend><bdo id='axfnY'><pre id='axfnY'><center id='axfnY'></center></pre></bdo></b><th id='axfnY'></th></span></q></dt></tr></i><div id='axfnY'><tfoot id='axfnY'></tfoot><dl id='axfnY'><fieldset id='axfnY'></fieldset></dl></div>

      1. <tfoot id='axfnY'></tfoot>
      2. 如何使用 TSQL 获取数据库中所有表的列表?

        时间:2023-07-17

          <i id='prbgr'><tr id='prbgr'><dt id='prbgr'><q id='prbgr'><span id='prbgr'><b id='prbgr'><form id='prbgr'><ins id='prbgr'></ins><ul id='prbgr'></ul><sub id='prbgr'></sub></form><legend id='prbgr'></legend><bdo id='prbgr'><pre id='prbgr'><center id='prbgr'></center></pre></bdo></b><th id='prbgr'></th></span></q></dt></tr></i><div id='prbgr'><tfoot id='prbgr'></tfoot><dl id='prbgr'><fieldset id='prbgr'></fieldset></dl></div>

              <tbody id='prbgr'></tbody>
            <legend id='prbgr'><style id='prbgr'><dir id='prbgr'><q id='prbgr'></q></dir></style></legend>
          1. <tfoot id='prbgr'></tfoot>
              <bdo id='prbgr'></bdo><ul id='prbgr'></ul>

                  <small id='prbgr'></small><noframes id='prbgr'>

                  本文介绍了如何使用 TSQL 获取数据库中所有表的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  获取 SQL Server 上特定数据库中所有表名称的最佳方法是什么?

                  What is the best way to get the names of all of the tables in a specific database on SQL Server?

                  推荐答案

                  SQL Server 2000、2005、2008、2012、2014、2016、2017 或 2019:

                  SQL Server 2000, 2005, 2008, 2012, 2014, 2016, 2017 or 2019:

                  SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'
                  

                  仅显示特定数据库中的表

                  To show only tables from a particular database

                  SELECT TABLE_NAME 
                  FROM [<DATABASE_NAME>].INFORMATION_SCHEMA.TABLES 
                  WHERE TABLE_TYPE = 'BASE TABLE'
                  

                  或者,

                  SELECT TABLE_NAME 
                  FROM INFORMATION_SCHEMA.TABLES 
                  WHERE TABLE_TYPE = 'BASE TABLE' 
                      AND TABLE_CATALOG='dbName' --(for MySql, use: TABLE_SCHEMA='dbName' )
                  

                  PS:对于 SQL Server 2000:

                  PS: For SQL Server 2000:

                  SELECT * FROM sysobjects WHERE xtype='U' 
                  

                  这篇关于如何使用 TSQL 获取数据库中所有表的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何通过使用 T-SQL 将两个整数值相除来获得浮点结果? 下一篇:SQL Server中Oracle的CONNECT BY PRIOR的模拟

                  相关文章

                  <i id='Pl49j'><tr id='Pl49j'><dt id='Pl49j'><q id='Pl49j'><span id='Pl49j'><b id='Pl49j'><form id='Pl49j'><ins id='Pl49j'></ins><ul id='Pl49j'></ul><sub id='Pl49j'></sub></form><legend id='Pl49j'></legend><bdo id='Pl49j'><pre id='Pl49j'><center id='Pl49j'></center></pre></bdo></b><th id='Pl49j'></th></span></q></dt></tr></i><div id='Pl49j'><tfoot id='Pl49j'></tfoot><dl id='Pl49j'><fieldset id='Pl49j'></fieldset></dl></div>

                  <small id='Pl49j'></small><noframes id='Pl49j'>

                1. <legend id='Pl49j'><style id='Pl49j'><dir id='Pl49j'><q id='Pl49j'></q></dir></style></legend>
                    <bdo id='Pl49j'></bdo><ul id='Pl49j'></ul>

                    <tfoot id='Pl49j'></tfoot>