A query slowed to over 10 minutes because of a big key lookup. Here is how I optimize key lookup operations by creating an index with include columns.
Puzzle – Datatime to DateTime2 Conversation in SQL Server 2017
At PASS, SQL Server expert Christopher Savage showed me a puzzle on DateTime to DateTime2 conversion in SQL Server 2017. I still have no answer, so can you solve it?
SQL SERVER – How to Escape a Single Quote in SQL Server?
In my earlier post on “How to Escape a Single Quote in SQL Server? – Interview Question of the Week #192 I showed you a method of escaping a single quote.
How to Find Size of the Index for Tables? – Interview Question of the Week #198
How do you find the size of the index for tables? A client asked me during a Health Check, and this script lists schema, table, index and size in KB and MB.
Build Your Own SQL Script Library
A SQL script library saves you from solving the same problem twice. This post shows a folder layout by task, a header block with the tested version, naming habits, a safe history, tests on a scratch server and a way to retire old scripts, with one small read-only script as an example.




