The rightmost part of the expression with the specified number of characters.
is a character or binary-type column name, variable, or constant expression of char, varchar, nchar, unichar, nvarchar, univarchar, binary, or varbinary type.
is any integer (tinyint, smallint, or int) column name, variable, or constant expression.
select right("abcde", 3)
select right("abcde", 2)
select right("abcde", 6)
select right(0x12345000, 3)
select right(0x12345000, 2)
select right(0x12345000, 6)
right, a string function, returns the specified number of characters from the rightmost part of the character or binary expression.
If the specified rightmost part begins with the second surrogate of a pair (the low surrogate), the return value starts with the next full character. Therefore, one less character is returned.
The return value has the same datatype as the character or binary expression.
If expression is NULL, returns NULL.
For general information about string functions, see “String functions”.
SQL92 – Compliance level: Transact-SQL extension
Any user can execute right.
Functions rtrim, substring