获取数据库表字段备注
Posted 聆道
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了获取数据库表字段备注相关的知识,希望对你有一定的参考价值。
mysql写法:
SELECT COLUMN_NAME, DATA_TYPE, COLUMN_COMMENT FROM information_schema. COLUMNS WHERE table_name = ‘表名‘
SQL Server写法:
SELECT A.name AS table_name, B.name AS column_name, C.value AS column_description FROM sys.TABLES A INNER JOIN sys.COLUMNS B ON B.object_id = A.object_id LEFT JOIN sys.extended_properties C ON C.major_id = B.object_id AND C.minor_id = B.column_id WHERE A.name = ‘表名‘
以上是关于获取数据库表字段备注的主要内容,如果未能解决你的问题,请参考以下文章