本文主要是介绍sqlServer表名|字段|备注查询,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
sqlServer查询表名与描述
SELECT tbs.name as tableName,ds.value as tableComment
FROM sys.extended_properties ds LEFT JOIN sysobjects tbs ON ds.major_id=tbs.id
WHERE ds.minor_id=0
sqlServer查询表中字段名与描述
select a1.name as columnName,b.value as columnComment
from sysobjects a
left join sys.columns a1 on a.id = a1.object_id
left join sys.extended_properties b on b.major_id = a.id and b.minor_id = a1.column_id
where a.name='表名字'
提示:在顶固项目中调整了sqlServer生成代码逻辑,主要参与类
TableFieldListSql、TableListSql、DataSourceConfigWrapper、
SqlServerQueryWrapper、AbstractMpGenerator
slqServer查询一行数据
SELECT top 1 * FROM soft_sorting_task t
*:为表中所有字段,注意 top 1 后面没有逗号
这篇关于sqlServer表名|字段|备注查询的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!