查看表结构简单命令。
一、简单描述表结构,字段类型desc
tabl_name
显示表结构,字段类型,主键,是否为空等属性,但不显示外键。
二、查询表中列的注释信息
select
*
from
information_schema.columns
where
table_schema
=
'db'
#表所在数据库
mssql查询:
SELECT so.[id] AS ObjectID,so.[name] AS ObjectName, so.XType,
(CASE WHEN (LEFT(text, 2) = '/*')
AND (charindex('*/', text) > 0) THEN substring([text], 3, patindex('%*/%', text) - 3)
ELSE '' END) AS Comments
FROM syscomments AS sc full join sysobjects AS so ON so.[id] = sc.[id]
WHERE so.[xtype] = 'U' OR so.[xtype] = 'V'
mysql表注释查询:
select table_name,table_comment from information_schema.tables where table_schema = 'image' and table_name ='tableName'欢迎分享,转载请注明来源:内存溢出
评论列表(0条)