Pages

Thursday, September 4, 2014

3 different way to find row count of a table ? TIP #45

 

Problem:-

Many times you want to know how many rows exists in the particular tables.

So let me share 3 different way to know this thing

Solution:-

Let me share 3 different options

Option 1:-

You all aware of this term which is Count function

SELECT COUNT(1)  As Rows FROM [Person].[Person]

Option 2:-

Sp_Space used is another way to determine rows in table as shown in below figure

No_Of_Rows_Sp_Space_used

Option 3:-

it is little bit tricky but you will enjoy seeing this. We count the row number from cluster index

Partitionrownumber

 

I hope you enjoyed.

Thanks & Enjoy !!!

RJ

No comments:

Post a Comment