LEFT (TSQL Function)
Returns the left part of a string, which length is at most the specified length.
Syntax
LEFT ( string_expression , length )
Arguments
- string_expression
- is a string expression of type
varchar
. - length
- is an integer expression of type
int
. It must be >= 0.
Return Types
Returns varchar
.
Examples
PRINT LEFT('Il était une fois.', 5);
PRINT LEFT('Il était une fois.', 100);
The result is:
Il ét
Il était une fois.