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

What are the types of subquery?

737


What is optimistic concurrency?

749


what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration

706


What is nolock?

747


What are sql azure firewall rules?

97






How do clustered indexes store data?

802


What is the optimization being performed in oracle and SQL Server?

797


Explain transaction server distributed transaction?

677


Does transparent data encryption provide encryption when transmitting data across the network?

804


What is ssrs?

109


How can you ensure that the database and sql server based application perform well?

795


How do I partition a table in sql server?

713


What is difference between joins and subqueries?

737


What is the latest version of microsoft sql server?

671


How to update values in a table with update statements in ms sql server?

739