DISTINCT and GROUP BY do not always help. I use ROW_NUMBER to eliminate duplicate data and keep only the record with the highest price.
SQL SERVER – Answer – How to Convert Hex to Decimal or INT
Readers sent great answers on how to convert Hex to Decimal or INT in SQL Server. Here are their solutions, with due credit, using 0x00000100 as the example.
SQL SERVER – Observation of Top with Index and Order of Resultset
Adding an index can change which rows TOP returns when there is no ORDER BY. I share three real cases where the order of resultset was blamed on the wrong thing.
Keeping Database Documentation Next to the Code
Keep database documentation close to SQL Server objects with extended properties, durable module comments, and catalog-generated reports.
Time-Limited Access: Expiring Grants With a Valid-Until Column
A ValidUntil column does nothing by itself. Here is how to make the read path enforce it, with a demo you can run.
SQL SERVER – INFORMATION_SCHEMA.COLUMNS and Value Character Maximum Length -1
Why does INFORMATION_SCHEMA.COLUMNS show -1 as the character maximum length? A reader asked me this simple question, and I explain what the negative value means.
SQL SERVER – Find Column Used in Stored Procedure – Search Stored Procedure for Column Name – Part 2
Readers improved my script to find column used in stored procedure. Imran Mohammed shares newer scripts to search stored procedure for column name.






