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 define the name and server for a new dsn?

643


what is a join and explain different types of joins? : Sql server database administration

616


Explain what are the restrictions that views have to follow? : SQL Server Architecture

691


What are the five characteristics of good data?

593


Define candidate key, alternate key, and composite key.

610






How to create new table with "create table" statements?

642


What is the contrast between sql and mysql?

689


Does sql server use t sql?

618


What options are available to audit login activity? : sql server security

720


What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?

827


What are the differences between union, intersect, and minus operators?

669


Do you know the cursor optimization tips?

661


What is bcp? When does it use?

589


Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?

114


How to find the list of fixed hard drive and free space on server?

687