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

Answer Posted / dharmendra k. dixit

@Anshul..
Bro..through your code u can obtain the Total numbers of
rows in your Table.
---------------------------------

For getting Total Columns i will use this:

SELECT Count(*)As Coloumns
FROM Sys.SysColumns
Where ID =
(SELECT ID FROM Sys.SysObjects Where Name = 'YourTableName')

Is This Answer Correct ?    34 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql profiler. What are the default templates with it? : sql server database administration

523


Explain can you implement data mining in ssrs?

106


Tell me what is log shipping?

575


explain databases and sql server databases architecture? : Sql server database administration

526


How to get a list all databases on the sql server?

585






What is temporal table?

490


Why we use trigger in sql server with example?

514


What is @@error in sql?

627


what's the difference between a primary key and a unique key? : Sql server database administration

507


How can you tell if a database object is invalid?

619


What is a transactions?

606


What are the different types of sub-queries?

602


What is bit data type? What's the information that can be stored inside a bit column?

529


What are xml indexes?

532


What is nonclustered index with included columns ?

556