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

Write a program using SQL queries to find a unique entry in a table.

621


How to modify an existing user defined function?

685


What is the purpose of floor function?

639


what are the new features in SSRS?

111


What is truncate table?

629






What is the difference between for trigger and after trigger?

629


How many types of attribute relationships are there? : sql server analysis services, ssas

674


Explain syntax for viewing trigger?

619


How to create a scrollable cursor with the scroll option?

569


what are the basic functions for master, msdb, model, tempdb and resource system databases? : sql server database administration

657


What is mscorsvw.exe - process - microsoft .net framework ngen?

611


What is self contained sub query?

646


What happens if strings are casted into wrong code pages in ms sql server?

695


Which is faster statement or preparedstatement?

618


Explain system scalar functions?

664