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

Answer Posted / vidit tyagi

SELECT Count(*)As Coloumns
FROM SysColumns
Where ID =
(SELECT ID FROM SysObjects Where Name = 'TableName')

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know what is normalization of database? What are its benefits?

566


What part does database design plays a role in performance of an sql server-based application?

530


How will you hide an attribute? : sql server analysis services, ssas

528


Can you tell me about the concept of ER diagrams?

600


What program is used to store the data source file?

509






What are the purposes and advantages stored procedure?

503


How to update muliple row in single query?

616


How many ways to create table-valued functions?

586


What is user defined datatypes and when you should go for them?

591


When would you prefer to have a minimum number of indexes?

509


What are user-defined functions (udfs) in sql server?

576


What is the use of attributehierarchyvisible ? : sql server analysis services, ssas

579


How to use old values to define new values in update statements in ms sql server?

689


What is truncate table?

553


Can two different columns be merged into single column? Show practically?

615