The UNION operator removes duplicates from a query result without deleting source rows. I use a small example to show that distinction.
Log Reuse Wait Reason AVAILABILITY_REPLICA: What It Means and How to Fix It
A customer’s database always showed AVAILABILITY_REPLICA as the log reuse wait reason in sys.databases. Here is what it means and three causes to check: a slow network, a long running transaction and a resource constraint.
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.
Where is the Default Settings for Backup Compression? – Interview Question of the Week #191
Where are the default settings for backup compression? The Back Up dialog shows three options. Here is where the server default lives and how to set it.
Estimated Completion Time for Backup, Restore and DBCC
The estimated completion time of a backup, restore or DBCC command is one query away. This post builds a monitor query on sys.dm_exec_requests and watches a backup, a restore and a DBCC check in a second window. It also covers STATS and the DBCC step name.
Max Degree of Parallelism for Microsoft Dynamics CRM
Max degree of parallelism controls how many cores one query can use, and the vendor guidance for Microsoft Dynamics CRM has been 1. This post measures what parallel plans cost on a heavy and a small query. It shows a database scoped limit and the instance wide statements.
Extract Decimal Part of a Number in SQL Server
To extract decimal part of a number in SQL Server, use ABS(value) % 1. This post compares four methods on positive and negative amounts and explains why the result is sometimes 0. It also covers float columns, digits as whole numbers and trailing zeros.







