Results for “SQL Server”
Small, practical examples. Search by task or narrow things down below.
Match a text prefix
SQL Server: Use a percent wildcard after a known prefix.
SQL Server✓ Tested
Match one value from a short list
SQL Server: Use IN for a set of allowed values.
SQL Server✓ Tested
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
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
Normalize ASCII text to uppercase
SQL Server: UPPER changes character case under the database’s text rules.
SQL Server✓ Tested
Pair employees with their managers
SQL Server: Alias a table twice to represent two different roles in one relationship.
SQL Server✓ Tested
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
Rank tied scores with competition gaps
SQL Server: RANK leaves a gap after tied rows, unlike DENSE_RANK.
SQL Server✓ Tested
Rank tied scores without gaps
SQL Server: DENSE_RANK assigns equal ranks to ties and increments by one for the next distinct score.
SQL Server✓ Tested
Read a page after a known unique key
SQL Server: A keyset predicate avoids scanning and discarding an increasing offset on a suitable index.
SQL Server✓ Tested
Read named columns from a table
SQL Server: Choose the columns needed and request a deterministic row order.
SQL Server✓ Tested
Read the last value of the complete partition
SQL Server: Specify an unbounded-following frame so LAST_VALUE does not stop at the current row.
SQL Server✓ Tested