how to find number of columns in a table in sql server 2000 and 2005 also
select count(*) NoOfColumns from SYSCOLUMNS WHERE id= (Select id from SYSOBJECTS where name = 'city') In this querry may name is Tablename