SQL Record Count

The fastest way to perform a SQL record count is:

DECLARE @TableName sysname
SET @TableName = 'Log'
SELECT TBL.object_id, TBL.name, SUM(PART.rows) AS rows
FROM sys.tables TBL
INNER JOIN sys.partitions PART ON TBL.object_id = PART.object_id
INNER JOIN sys.indexes IDX ON PART.object_id = IDX.object_id
AND PART.index_id = IDX.index_id
WHERE TBL.name = @TableName
AND IDX.index_id < 2
GROUP BY TBL.object_id, TBL.name;

Fault tolerance using Polly

What is a Resilience Framework?

Polly is classed as a resilience framework. A resilience framework is a set of libraries that help an application to recover from transient or more extended failures in services or infrastructure upon which it depends. When recovery is not possible, the resilience framework will facilitate graceful degradation of your application.

Polly has been around for many years and has been tried and tested in many applications


The source code for Polly can be found on GitHub here:


Continue reading Fault tolerance using Polly

this and that