To count NULLs in a column, filter with IS NULL and count the rows, or subtract COUNT(column) from COUNT(*). This post tests five ways on 100,000 rows and compares their page reads. It also counts NULLs in several columns at once and shows the NULL group in GROUP BY.
SELECT INTO Table Variable: Why It Fails and What to Use
SELECT INTO table variable fails with Msg 102 because SELECT INTO creates its target table and a table variable must be declared first. This post shows two working fixes, a declared table variable and a temp table. It also compares them on rollback, dynamic SQL and row estimates.
How to Join Two Tables Without Using Join Keywords? – Interview Question of the Week #266
Question: How to Join Two Tables Without Using Join Keywords?
Answer: In my life, I have attended many interviews as an interviewer.
Detecting Changed Rows With a Row Hash
Compare one fingerprint instead of twenty columns. I show a safe HASHBYTES recipe, the NULL trap that fools CONCAT_WS, and a load that touches only the rows that changed.
Smiley in SSMS: Show Emoji in Results and Database Names
To show a smiley in SSMS, type the emoji inside an N-prefixed string and run the query. This post explains how SQL Server stores each emoji as two characters, why two different emoji can compare as equal, and how to find them in a column. It also shows what happens when an emoji is part of a database name.
AUTOGROW_ALL_FILES: What Replaced Trace Flags 1117 and 1118
AUTOGROW_ALL_FILES and MIXED_PAGE_ALLOCATION replaced trace flags 1117 and 1118, which once made tempdb grow its files together and use whole extents. This post checks the flags on a server, reads the settings that replaced them and demonstrates both on a demo database. It also says what to do with a startup parameter that still names them.
Listing Objects Changed Since the Last Release With modify_date
modify_date shows what changed after a release, but never what was dropped. Here is a small baseline trick that fills the gap.










