A CSV import crashed on the date 30/2/2007. Use the ISDATE() function to validate a VARCHAR column in a staging table before moving rows to a DATETIME field.
TRY_CONVERT Integer Validation: Check the Target Type
TRY_CONVERT integer validation starts with the destination type and a separate input policy. This example compares blank, signed, decimal and overflowing text without writing data.
Keeping an Inventory of Every SQL Server You Own
Build an Inventory of Every SQL Server you own, including hidden instances, owners, versions, recovery details, and a process to keep it current.
CONCAT_WS: Keep NULL and Empty Strings Separate
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 and Comparison of NULLIF and ISNULL
NULLIF returns NULL when two expressions are equal and the first one when they are not. Here is how it compares with ISNULL and the matching CASE expression.







