查詢表名為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'