how to find number of columns in a table in sql server 2000
and 2005 also

Answer Posted / amit

SELECT count(*) NoOfColumns FROM SYSCOLUMNS
WHERE id= (Select id from SYSOBJECTS where name
= 'TableName')

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between set and select?

740


How do I connect to sql server database?

683


How to count groups returned with the group by clause in ms sql server?

738


in the physical file layout, where should the transaction log be stored in relation to the data file?

720


What is a database in ms sql server?

735






What are the different types of indexes?

770


What is the difference between mysql and mysqli?

752


What is the purpose of forms?

685


What are the different types of normalization?

809


can a table be moved to different filegroup? : Sql server administration

714


Can an entity have two primary keys?

725


How do I start sql server agent automatically?

690


Describe and explain about SQL native client?

786


What is the difference between the export /import functions in sql studio and standalone sql manager? : sql server management studio

795


What is the full form of ddl?

666