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

Difference between group by clause and having clause in SQL?

559


What are the different types of triggers in SQL SERVER?

529


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

532


What are the advantages of policy management?

575


What to check if a User database is locked?

580






How to get a list of columns in a view using the "sp_columns" stored procedure?

606


How will you know when statistics on a table are obsolete?

595


How to write a query with a full outer join in ms sql server?

553


when would you go for denormalization? : Sql server database administration

477


What do you understand by the analysis services in sql server?

528


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

561


What are partitioned views and distributed partitioned views?

593


What is table constraint?

532


What are the types of resultset?

521


What is shrink log file?

502