首页 > 代码库 > SQL SERVER 查询一个表有多少列

SQL SERVER 查询一个表有多少列

select count(1) from syscolumns where id = object_id(tbname)或者select * from syscolumns where id = object_id(tbname)或SELECT MAX(colid) FROM syscolumns WHERE id=OBJECT_ID(table)

 

SQL SERVER 查询一个表有多少列