SQL Query - 1:
SELECT COUNT(*)FROM TableName
SQL Query - 2:
SELECT rows FROM sysindexes WITH (NOLOCK) WHERE id = OBJECT_ID('TableName') AND IndId < 2
SQL Query - 3:
SELECT COUNT(*)FROM TableName where id=101
SELECT COUNT(*)FROM TableName
SQL Query - 2:
SELECT rows FROM sysindexes WITH (NOLOCK) WHERE id = OBJECT_ID('TableName') AND IndId < 2
SQL Query - 3:
SELECT COUNT(*)FROM TableName where id=101
As per my knowledge..
ReplyDeleteSql query-2: will be fast.But known the deep concept.
If any one knows that better to me then post the Comment.
ThanKs!!
Ashish Verma