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

How to set a database state to offline in ms sql server?

543


How do I view a procedure in sql server?

541


What is the maximum row of a size?

577


What is the purpose of data source?

514


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

542






How to trouble shoot if unable to connect SQL Server

1482


What do you understand by SQL*Net?

617


Can we use trigger new in before insert?

519


Explain what are the restrictions while creating batches in sql server?

591


What is an indice?

577


List out different types of normalizations in sql server and explain each of them?

559


What is rs.exe utility?

118


What is data block and how to define data block size?

607


What is public role in sql server?

540


Can we do dml on views?

555