阅读116 返回首页    go 阿里云 go 技术社区[云栖]


根据数据库表名查询该表字段名、字段类型、以及注释

select
c.name as column_name,t.name as data_type,
(select value from sys.extended_properties as ex where ex.major_id = c.object_id and ex.minor_id = c.column_id) as notes
from
 sys.columns as c inner join sys.tables as ta on c.object_id=ta.object_id inner join 
(select name,system_type_id from sys.types where name<>'sysname') as t on c.system_type_id=t.system_type_id
where  ta.name='PE_Address' order by c.column_id

 

'PE_Address' 为要查询的数据表名;

 

最后更新:2017-04-02 06:51:23

  上一篇:go 模板方法模式的例子
  下一篇:go magento 新版本接踵而至