FIND YOUR NEXT FEW LINES

The snippet library.

Small, practical examples. Search by task or narrow things down below.

10 snippets foundClear filters
SQL ServerText cleanup & matching

Combine text values with a separator

SQL Server: Use the concatenation operator supported by the selected SQL dialect.

SQL Server✓ Tested
SQL ServerText cleanup & matching

Match a known text prefix

SQL Server: A percent wildcard matches zero or more characters following the prefix.

SQL Server✓ Tested
SQL ServerText cleanup & matching

Measure the length of ordinary text

SQL Server: Use the engine’s text-length function; this ASCII example has no trailing spaces.

SQL Server✓ Tested
SQL ServerText cleanup & matching

Normalize ASCII text to lowercase

SQL Server: LOWER is useful for display normalization; indexed case-insensitive search depends on the database collation and schema.

SQL Server✓ Tested
SQL ServerText cleanup & matching

Normalize ASCII text to uppercase

SQL Server: UPPER changes character case under the database’s text rules.

SQL Server✓ Tested
SQL ServerText cleanup & matching

Place missing values after known values portably

SQL Server: A CASE sort key controls NULL placement without relying on engine-specific defaults.

SQL Server✓ Tested
SQL ServerText cleanup & matching

Remove surrounding spaces from text

SQL Server: TRIM removes leading and trailing space characters by default.

SQL Server✓ Tested
SQL ServerText cleanup & matching

Replace a literal substring

SQL Server: REPLACE performs a literal replacement rather than a regular-expression substitution.

SQL Server✓ Tested
SQL ServerText cleanup & matching

Search for a literal LIKE wildcard

SQL Server: Declare an escape character so a percent sign in the pattern is literal.

SQL Server✓ Tested
SQL ServerText cleanup & matching

Treat an empty trimmed value as missing

SQL Server: NULLIF converts an empty string to NULL before a fallback is applied.

SQL Server✓ Tested