CEILING and FLOOR follow numeric order even below zero. This example compares both boundaries with truncation and explicitly defines its displayed decimal types.
SQL SERVER – Get Information of Index of Tables and Indexed Columns
sp_helpindex is a handy stored procedure that shows every index on a table, its description and the indexed columns. One line of T-SQL does it.
SQL SERVER – T-SQL Script to Find Details About TempDB Information
TempDB Information starts with the files and their actual locations. I inspect every data and log file before proposing changes.
SQL SERVER – UDF – Remove Duplicate Chars From String
A reader, Virendra Chauhan, shared a UDF that removes duplicate chars from one large string. Here is his REMOVE_DUPLICATE_INSTR function and how to call it.
ReorientObject: Swap a Geographic Ring’s Interior
ReorientObject swaps a geography polygon’s interior and exterior. Compare inside and outside witnesses, then reorient twice to restore membership.
OR in a JOIN: Preserve Matching Pairs When Rewriting
OR in a JOIN matches either key while returning each pair once. Compare NULL cases and pair counts before rewriting. Measure the actual plan only after proving the results.







