Recently while working with my client I ended up in a very interesting situation where my client wanted me to write an Efficient Query.
Scan Count Zero in STATISTICS IO: What the Number Means
Scan count zero in STATISTICS IO is not an error and not a free read. This post runs nine small queries and shows what 0, 1, 2 and 5 mean, why a unique lookup counts as zero, and why logical reads are the number to compare.
SET STATISTICS TIME ON – SQL in Sixty Seconds 139
Do you know how long your query took to execution? Well, let us learn that today in SQL in Sixty Seconds. We will discuss SET STATISTICS TIME ON.
Alerting on Long-Running Queries With a SQL Agent Job
Alert on long-running queries with a five-minute SQL Agent job, a deduplicated log, and one Database Mail notice per new request.
Check Constraint on Identity Column: Why Inserts Fail
A check constraint on identity column values can make every insert fail, because the identity moves on whether or not the row is accepted. This post reproduces the failure, shows that the failed attempts still use up identity values, and lists every such constraint in a database with one query.







