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 is the difference between cube operator and rollup operator? : SQL Server Architecture

625


Explain Geography datatype in SQL Server

631


When you use @@error and try-catch?

576


SQL Server Architecture ?

1936


How to get the definition of a trigger back?

551






Explain concepts of analysis services?

513


What are the advantages of paper records?

556


When would you use an insert into .. Select option versus an insert into .. Values option? Give an example of each?

654


What is a transactions?

606


What is the recursive stored procedure in sql server?

527


What is meant by indexing?

507


Can group functions be used in the order by clause in ms sql server?

588


How many levels of sp nesting is possible?

586


What happens to a trigger with multiple affected rows?

528


What is the dbcc command and why is it used?

573