当前位置:Gxlcms > mysql > SqlServer查询表中各列名称、表中列数

SqlServer查询表中各列名称、表中列数

时间:2021-07-01 10:21:17 帮助过:220人阅读

查询表名为tb_menu的所有列名 ? 1 select name from syscolumns where id=object_id('tb_menu') 查询表名为tb_menu的所有列名个数 ? 1 select count(name) from syscolumns where id=object_id('tb_menu') 或者 ? 1 2 3 select count(syscolumns.name) fro

  查询表名为tb_menu的所有列名
?

1

select name from syscolumns where id=object_id('tb_menu')

  查询表名为tb_menu的所有列名个数

?

1

select count(name) from syscolumns where id=object_id('tb_menu')

  或者

?

1

2

3

select count(syscolumns.name)

from syscolumns ,sysobjects

where syscolumns.id=sysobjects.id and sysobjects.name = 'tb_menu'

人气教程排行