LEFT
string transform
What changes
- Input
- string arguments
- Output or change
- string or integer
- Return type
- Returns varchar when character_expression is a non-Unicode character data type. Returns nvarchar when character_expression is a Unicode character data type.
Syntax at a glance
LEFT ( character_expression , integer_expression )
Work example
Keep a leading portion of text for a preview or fixed-width label.
Confirm whether the limit counts characters and whether the source may be Unicode.
Check your work LEFT counts characters, and a negative length raises an error.
Practice SQL
Open in SQL FlowSELECT LEFT('Warehouse', 5) AS prefix;
Open Microsoft Learn for full syntax, permissions, and details for your version.