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 are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security

558


Other than truncate statement, which other command can by-pass the trigger on the tables?

628


What are Spatial data types in SQL Server 2008

564


What is report subscription?

93


Can you roll back the ddl statement in a trigger?

529






What is your recommendation for a query running very slow? : sql server database administration

597


How to connect a database with sql express.?

580


Why I have to use stored procedures?

602


What is report snapshot in ssrs?

166


If a user does not have permission to a table, but has permission to a view created on it, will he be able to view the data in table?

559


How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

1638


Define union, union all, minus, intersect?

583


What is function of ROLLUP ?

664


How to get the definition of a user defined function back?

582


How to connect to SQL Azure Database by using sqlcmd?

112