Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

What is Difference Between Count(), Scope_identity(), @@identity

$
0
0

Dear sir/madam.

I have confusing when I am using Count(), Scope_identity(), and @@identity, these all functions have same work to return the last/ maximum value which is produced by the identity column. So my question is that if these all has same properties than what is major difference between them?

Because if I use  count() function to get the last value of identity column, and similarly the above function also return the same result so how I can distinguish between them? 


Viewing all articles
Browse latest Browse all 12963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>