CONCAT_WS joins values with a separator, but NULL and empty strings have different effects. These examples keep the original fields beside the combined text and byte length.
LAST_VALUE: Set the Window Frame for the Final Row
LAST_VALUE changes with its window frame. Compare implicit and whole-partition frames, order tied rows and preserve a final NULL.
BIT_COUNT: Count Set Bits Without Changing Integer Width
BIT_COUNT counts active positions in a typed value. Keep integer width visible and distinguish a missing mask from a zero count.
SQL SERVER – Explanation of WITH ENCRYPTION clause for Stored Procedure and User Defined Functions
Use WITH ENCRYPTION to hide the code of a stored procedure or UDF, but keep a copy of the script. Once encrypted, there is no simple way to decrypt it.
SQL SERVER – Recompile All The Stored Procedure on Specific Table
After BCP or DTS mass inserts, stored procedures can slow down. I use sp_recompile to recompile all the stored procedure on a table, or just one procedure.
REPLACE Return Limits: Cast the Input to max
REPLACE return limits can truncate text at 8,000 bytes. Cast the searched input to max first, then compare Unicode and non-Unicode byte lengths.







