How do you escape a single quote in SQL Server? A college student asked me at a Bangalore user group, a few people laughed, and here is the simple answer.
Inline Table-Valued Functions: Parameterized Views That Stay Fast
Compare inline table-valued functions with scalar functions, preserve customer results, and inspect plans before claiming performance gains.
SQL SERVER – Restoring SQL Server 2017 to SQL Server 2005 Using Generate Scripts
I used generate scripts for a historical SQL Server 2017-to-2005 migration. It was a logical migration rather than a backward backup restore.
SQL SERVER – Simple Method to Find FIRST and LAST Day of Current Date
I calculate the FIRST and LAST Day of Current Date using explicit date boundaries. The historical sample starts on October 28, 2017.
SQL SERVER – Remove Duplicate Rows Using UNION Operator
The UNION operator removes duplicates from a query result without deleting source rows. I use a small example to show that distinction.
SQL SERVER – How to Fix log_reuse_wait_desc – AVAILABILITY_REPLICA?
A client’s database always showed AVAILABILITY_REPLICA in log_reuse_wait_desc of sys.databases. After quick research, here is what it means and how to fix it.
Find the Query Growing TempDB in SQL Server
To find the query growing TempDB, read the space each session has allocated and join it to its statement. This post separates temporary tables from spills, watches both live in a second window and shows the totals after a query ends. It ends with ways to fix a spill.






