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



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


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


Option 3:-

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



I hope you enjoyed.

Thanks & Enjoy !!!



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s