Wednesday, 1 February 2012

Which query will be fast to give the records

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