首页 行业资讯 宠物日常 宠物养护 宠物健康 宠物故事

列出一个数据库的所有表名,或者列出每个字段及字段类型

发布网友 发布时间:2022-04-26 23:51

我来回答

1个回答

热心网友 时间:2022-04-08 23:30

SELECT TOP 100 PERCENT c.colid AS 序号, o.name AS 表名, c.name AS 列名,
t.name AS 类型, c.length AS 长度, c.isnullable AS 允许空,
CAST(m.[value] AS Varchar(100)) AS 说明
FROM dbo.syscolumns c INNER JOIN
dbo.sysobjects o ON o.id = c.id AND objectproperty(o.id, N'IsUserTable') = 1 AND
o.name <> 'dtproperties' INNER JOIN
dbo.systypes t ON t.xusertype = c.xusertype LEFT OUTER JOIN
dbo.sysproperties m ON m.id = o.id AND m.smallid = c.colorder
ORDER BY o.name, c.colid

什么也不用修改就可以了

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com