How do you stop people from using SELECT * in views? A slow query in a Health Check came from SELECT * over a wide view, so here is one way to prevent 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.
Asynchronous Statistics Updates: When They Help and When They Hurt
Evaluate asynchronous statistics updates against compile latency, data-change timing, and low-priority metadata locking in SQL Server.
Intelligent Query Processing: Checking What Is On per Database
Check intelligent query processing by database compatibility level, scoped switches, and actual plan evidence before comparing servers.
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.







