Sponsored By
MindStick Cleaner
Advertise with Us
Advertisement
Advertise with Us
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog
Report Abuse Form
Reason:    
   

Home >> Database >> MSSQL Server 2000/2005/2008/2012 >> Count number of tables in sql server
Author Post

Varun Agrawal


Total Post: 3
Member Since: 3/18/2011
Points: 15
Count number of tables in sql server
Posted On: 3/24/2011 8:13:10 AM

Hi,

I have a requirement where I want to count no. of tables present in Database.

Thanks

Author Post

Haider M Rizvi


Total Post: 40
Member Since: 6/6/2010
Points: 291
Re: Count number of tables in sql server
Posted On: 3/24/2011 8:15:36 AM
Report Abuse Answer

Hi Varun,

You can use below query to find total number of Table in your database.

select COUNT(*) from INFORMATION_SCHEMA.TABLES

Modified On: 3/24/2011 8:16:30 AM
Author Post

Amit Singh


Total Post: 104
Member Since: 8/8/2010
Points: 702
Re: Count number of tables in sql server
Posted On: 3/29/2011 8:23:34 AM
We count the tables in database

for example:
USE YOURDBNAME
SELECT COUNT(*) from information_schema.tables
WHERE table_type = 'base table'


Note: It will return you the count of the tables in the database.
Author Post

Shankar M


Total Post: 25
Member Since: 2/9/2013
Points: 169
Re: Count number of tables in sql server
Posted On: 2/9/2013 2:07:03 AM
You can also query 
SELECT *
  FROM SYS.objects
 WHERE TYPE = 'U' to get the tables associated with a particular user in the database. Here TYPE='U' is the User Tables.
Report Abuse Form
Reason:    
 
Total Online Users: 4204
Advertisement
MindStick DataConverter
Advertise with Us
  
Copyright © 2009 - 2013MindStick. All Rights Reserved.