Installing a SQL Server failover clustered instance failed the Cluster Remote Access rule. Here is what Detail.txt showed and the workaround I used.
How to Get Top N Records Per Group? – Ranking Function – Interview Question of the Week #156
I gave 40 candidates this puzzle: get the top N records per group from a student marks table. Here is the simple answer using a Ranking Function.
SQL SERVER – What Does SET NOEXEC Do?
What does SET NOEXEC do? With SET NOEXEC ON, SQL Server compiles your query but does not run it. Here is how the compile and execute phases work.
Change Column From NULL to NOT NULL in SQL Server
To change a column from NULL to NOT NULL, first fill every NULL value, then run ALTER COLUMN with the full data type and NOT NULL. This post shows the Msg 515 error you get otherwise, how to choose the replacement value, and the trap that makes a column nullable again. It ends with a default constraint that keeps new rows valid.
SQL SERVER – 2017 – How to Remove Leading and Trailing Spaces with TRIM Function?
TRIM finally arrived in SQL Server 2017. Here is how to remove leading and trailing spaces with the new TRIM function, in a few simple words.
Log Space Usage DMV: Check Transaction Log Space in T-SQL
The Log Space Usage DMV, sys.dm_db_log_space_usage, returns one row that shows how big the transaction log is, how full it is, and how much log has built up since the last log backup. This post builds a demo, reads each column, and uses the value to decide when a log backup is worth taking. It also covers open transactions and the simple recovery model.
SQL SERVER – Puzzle – Solution – Why Does UNION ALL Work but UNION Produces Error?
Here is the answer to my puzzle: why does UNION ALL work but UNION produces an error with a TEXT column? It comes down to how UNION removes duplicates.






