datetime2 precision changes can round into the next second or date. Compare typed seven-digit values with millisecond and whole-second conversions.
SQL SERVER – Indexed View always Use Index on Table
A table can have only one clustered index, but what about an indexed view built on the whole table? My T-SQL Tuesday post tests which index SQL Server uses.
SQL SERVER – Encrypted Stored Procedure and Activity Monitor
Can you see the definition of an encrypted stored procedure in Activity Monitor? The answer is No. Here is a quick test that proves it.
SQL SERVER – Simple Explanation of Data Type Precedence
A simple explanation of data type precedence: filter an INT and a VARCHAR column with N’1′ and N’First’, then see what the execution plan shows.
SQL SERVER – Quickest Way to Identify Blocking Query and Resolution – Dirty Solution
A friend could not delete, truncate or drop a table at 11 PM because of open transactions. Here is my quick and dirty way to identify blocking query.
SQL SERVER – Find Total Number of Transactions on Interval
How many Transactions run on your server per minute? A handy script reads sys.dm_os_performance_counters twice with a WAITFOR DELAY between the reads.
NO_PERFORMANCE_SPOOL: Compare the Work Before Keeping the Hint
NO_PERFORMANCE_SPOOL changes one query optimization decision. A guarded private fixture compares baseline work, the optional hint and a supporting inner index. The article explains how to preserve results and assess actual child work without promising a plan shape.





