① select count(1) from syscolumns where id=object_id(‘tablename‘)
② select count(*) from syscolumns where id=object_id(‘tablename‘)
③ select max(colid) from syscolumns where id=object_id(‘tablename‘)
原文:http://www.cnblogs.com/oceans106/p/5177929.html