sql – 数据库中所有表的列表

如何使用查询获取sql Server数据库中所有表的列表.我的目的是在网页上动态显示它.

解决方法

尝试:
SELECT [name] from sys.tables

这应该给你你想要的.然后,您需要从您的网页上调用它以显示所需的格式.

你可能想看到:

> How get the names of all the tables from a database in a combo box using c#

可能会帮助你做你想做的事情.

另外 – 您可能希望在sys.tables和informatION_SCHEMA中看到SQL Server: should I use information_schema tables over sys tables?.

informatION_SCHEMA是sql92标准,但我个人更喜欢MS-sql Universe中的sys.tables,因为它似乎(至少对我来说)结构良好并具有所有相关信息,例如索引信息在informatION_SCHEMA中不可用.

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...