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 the name of reporting services config file and what’s it’s used for?

119


What is a field name?

704


What is the difference between clustered and a non-clustered index?

765


How to stop a loop early with break statements in ms sql server?

761


How to use order by with union operators in ms sql server?

751






Why use view instead of a table?

704


Explain Normalization and DE normalization

791


what is an extended stored procedure? : Sql server database administration

705


What are the different types of stored procedures?

787


What is the difference between stored procedure and user defined functions?

846


Explain what are various ways to enhance the ssrs report?

776


What is scan table/view and seek table/view when its occurs? : sql server database administration

732


What the difference between UNION and UNIONALL?

747


What are the filtered indexes?

776


What does the on delete cascade option do?

743