Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can I show Count of database table and show it in gridview
Posted
Comments
_Ashish 23-Oct-11 15:13pm    
how do you show the count of rows in a table into a gridview? just the same way.
Query " Select count(*) from sys.tables"

1 solution

You can count your database tables using this query..

SQL
SELECT COUNT(*) FROM SYS.TABLES

OR

SELECT COUNT(*) FROM SYS.OBJECTS WHERE TYPE = 'U' /* HERE OBJECT 'U' NOTED FOR USER DEFINED TABLES */



FOR MORE DETAIL ON SYS.OBJECTS SEE THIS LINK
http://msdn.microsoft.com/en-us/library/ms190324.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900