查询表名为tb_menu的所有列名
select name from syscolumns where id=object_id('tb_menu')
查询表名为tb_menu的所有列名个数
select count(name) from syscolumns where id=object_id('tb_menu')
或者
select count(syscolumns.name)
from syscolumns ,sysobjects
where syscolumns.id=sysobjects.id and sysobjects.name = 'tb_menu'
更多精彩内容:http://www.bianceng.cnhttp://www.bianceng.cn/database/SQLServer/
时间: 2025-01-19 04:39:23