sql query to get column count of table-query to get number of columns in table

query to get number of columns of particular table using sqlserver

select count(*)as NOC from SYSCOLUMNS where id=(select id from SYSOBJECTS where name='tablename')

1 comment:

Haris Saleem said...

Thanks so much....Works like wonder!

Recent Posts