SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Count(*)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sanjay5219
Posting Yak Master

228 Posts

Posted - 10/02/2012 :  06:40:28  Show Profile  Reply with Quote
Hi All,

Is there any way where i can find the rows in all the tables.

Please suggest

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 10/02/2012 :  06:47:30  Show Profile  Reply with Quote
SELECT 
	OBJECT_NAME(OBJECT_ID) TableName, 
	row_count
FROM 
	sys.dm_db_partition_stats
WHERE 
	index_id < 2
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 10/02/2012 :  10:31:12  Show Profile  Reply with Quote
quote:
Originally posted by sanjay5219

Hi All,

Is there any way where i can find the rows in all the tables.

Please suggest


do you mean row count or rows present in all tables based on a value?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22755 Posts

Posted - 10/05/2012 :  04:55:24  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
quote:
Originally posted by visakh16

quote:
Originally posted by sanjay5219

Hi All,

Is there any way where i can find the rows in all the tables.

Please suggest


do you mean row count or rows present in all tables based on a value?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/




Most likely row count as the title says

Other methods http://beyondrelational.com/modules/2/blogs/70/posts/10817/different-ways-to-count-rows-from-a-table.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

mani_1234
Starting Member

India
24 Posts

Posted - 10/05/2012 :  05:50:12  Show Profile  Reply with Quote

select a.name , b.rows from sys.tables a
inner join sys.partitions b
on a.object_id = b.object_id
order by b.rows desc
Go to Top of Page

johncooper565
Starting Member

USA
1 Posts

Posted - 10/05/2012 :  05:54:27  Show Profile  Reply with Quote
Is there any way where i can find the rows in all the tables.

unspammed



Edited by - johncooper565 on 10/05/2012 05:55:11
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 10/06/2012 :  00:31:31  Show Profile  Reply with Quote
quote:
Originally posted by johncooper565

Is there any way where i can find the rows in all the tables.

unspammed





did you try any of suggestion above?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000