SQL Server Configuration Manager would not open on my VM: Cannot connect to WMI provider [0x80070422]. I share what caused it and how I fixed it.
Checking Optional Features Installed on an Instance From T-SQL
A 1 in SERVERPROPERTY does not mean the feature runs. Here is how I line up the flag, the setting and the service in one query.
Formatted Date Alias in ORDER BY: Sort by the Real Date in SQL Server
A formatted date alias can change ORDER BY from a date sort into a text sort. The tests here reproduce the wrong order, show three ways to sort by the real date, and explain the two errors you hit when you try to be clever with the alias.
SQL SERVER – Selecting Random n Rows from a Table
To select random-looking n Rows, I can sort by NEWID and use TOP. A developer wanted ten AdventureWorks Product rows.
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.






