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

Answer Posted / jerry joseph

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

Is This Answer Correct ?    14 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about local stored procedure?

512


Is null vs coalesce?

515


How can I check if a view exists in a sql server database?

573


What is primary key index?

545


How do you size a resultset?

512






What is the difference between value type and reference type?

565


Are there any preferred steps that need to be taken care of before starting the installation of sql server 2000?

582


What is a field name?

525


What is primary key and example?

518


What is difference between global temporary tables and local temporary tables?

672


why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration

569


What is SQL Azure Data sync?

105


What are the disadvantages of using the stored procedures?

555


You have to store user responses of ‘yes’ and ‘no’ what kind of data type is best suited for this task?

540


how can you check the level of fragmentation on a table? : Sql server administration

550