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

Answer Posted / ram&saran

SELECT COUNT(*) FROM SYS.COLUMNS WHERE ID=(SELECT * FROM
SYS.OBJECT WHERE NAME='TABLENAME')

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to create trigger on views?

710


What is an expensive query?

702


What is create command?

700


if you encounter this kind of an error message, what you need to look into to solve this problem? : Sql server database administration

719


Issues related in upgrading SQL Server 2000 to 2005 / 2008

1673






Your table has a large character field there are queries that use this field in their search clause what should you do?

693


What is sub query and its properties?

734


Do you know the policy based administration feature of sql server 2008?

734


What is the minimum recommended amount of ram for sql server 2012 enterprise?

686


What is the difference between stored procedure and functions?

775


What is transaction server isolation?

748


How to read data in a table with "select" statements?

735


What is data file in computer?

705


What are locks in sql?

707


What are the different types of columns types constraints in the sql server?

735