The PRINT date format differs from the SELECT format, because PRINT converts the value to text first. This post tests PRINT with six date and time types, shows why joining text and a datetime fails with Msg 241, shows how the session language changes the month name, and gives the formats that stay the same everywhere.
Actual Execution Plan in SQL Server: Graphical, Text and XML
An actual execution plan shows how SQL Server really ran a query, with the true row counts beside the estimates. This post gets the plan three ways, as a graphical plan, as text with SET STATISTICS PROFILE and as XML, and uses a demo table to show how the estimate and the actual number can disagree.
IO Stalls by Database File: Find the File to Move
IO stalls measure how long SQL Server waited for the disk, file by file. This post ranks the files of a demo database by stall time, measures a workload with two snapshots, lists the busiest files of a whole instance, and explains how to pick the one file that belongs on the new drive.
Remove Extra tempdb Files in SQL Server Safely
To remove extra tempdb files, empty each file first with DBCC SHRINKFILE and then remove it with ALTER DATABASE. This post checks the file count and the allocation waits before you start, rehearses both steps on a demo database, shows the tempdb statements with their undo, and explains why emptying can fail.
How to Create a Table Automatically in All Newly Created Databases? – Interview Question of the Week #238
Question: How to Create a Table Automatically in All Newly Created Databases? This question was recently asked in my recent consulting engagement
DATETIMEFROMPARTS Function: Build Dates From Parts
The DATETIMEFROMPARTS function builds a datetime value from seven numbers, with no string conversion and no language trap. This post tests how it rounds milliseconds, which parts raise an error, how it treats NULL, and how its relatives build dates, times and offsets.
Runnable Sessions in SQL Server: What to Check Next
Runnable sessions are sessions that have everything they need except a free CPU. This post counts requests by status, checks that SQL Server can see every processor, reads the settings that cap CPU use, and lists the statements waiting in the queue, so a long queue next to a half idle CPU stops being a puzzle.







