Store emoji safely with nvarchar or UTF-8 varchar, compare LEN and DATALENGTH, and choose message limits that fit full Unicode.
CHAR, VARCHAR, NVARCHAR and VARCHAR(MAX) Quiz: How Many Bytes?
This CHAR, VARCHAR, NVARCHAR and VARCHAR(MAX) Quiz stores the text abc in three columns and asks how many bytes each one uses. The answer is 10, 3 and 6. A tested script proves it and shows the trailing space trap, the question mark problem and the 8,000 byte limit.
LIKE Character Ranges: [a-f], [^0-9] and Collation Traps
A bracket range sounds simple until the collation decides what sits between a and f. Test it once so a bad code never reaches your table.
Finding Apostrophes in SQL Server Text: Straight and Curly
Finding apostrophes in SQL Server text takes one trick and one trap. The trick is doubling the quote inside a LIKE pattern. The trap is that text can hold a curly apostrophe, and the usual search skips it. This post tests both on a table of eight shop names.
Parameter Types From .NET: Stopping Implicit Conversions at the Source
Match parameter types from .NET to SQL Server columns, avoid implicit conversions, and inspect cached plans for mismatched strings.
Rows That Look Identical but Are Not: Finding Hidden Characters
Expose hidden characters with DATALENGTH and UNICODE, clean known whitespace safely, and add a constraint to prevent recurrence.







