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 后面没有逗号