A case-sensitive WHERE clause needs a COLLATE on the comparison, but the obvious version scans the index. A demo measures 286 reads against 2, and shows two fixes: keep the plain test beside it, or give the column a case-sensitive collation.
Escape Text for JSON: Build Valid JSON With STRING_ESCAPE
To escape text for JSON, pass each value through STRING_ESCAPE, so JSON built by hand stays valid. A demo shows which characters it escapes and which it leaves alone. It also shows when JSON_MODIFY and FOR JSON make it unnecessary.
Digits in a Column: A CHECK Constraint for Digits Only
To keep only digits in a column, a CHECK constraint with NOT LIKE and a character range works, but it has two holes. It accepts an empty string and digits from other scripts. A demo closes both and shows NULL, trust and fixed length codes.
LTRIM and RTRIM With Custom Characters in SQL Server 2022
Use LTRIM and RTRIM with custom characters in SQL Server 2022, understand character sets, test TRIM directions, and preserve valid text.
What is N in nvarchar? – Interview Question of the Week #301
Question: What is N in nvarchar?
Answer: n in nvarchar or nchar stands for world national. Let us learn today about datatypes.
Grid vs Text Output in SSMS: Why Line Breaks Disappear
Grid vs text output is a Management Studio setting that decides whether the line breaks in your data stay visible. This post builds a value with a line break, proves with T-SQL that the data holds it, and shows how to keep the break in each mode.
SQL SERVER – Unicode Storage and UTF8 Version Limits
nchar and nvarchar are usual types for Unicode character strings in SQL Server. Reader questions prompted my datatype summary.







