RIGHT (Transact-SQL)
SQL Server 2012
Returns the right part of a character string with the specified number of characters.
When using SC collations, the RIGHT function counts a UTF-16 surrogate pair as a single character. For more information, see Collation and Unicode Support.
The following example returns the five rightmost characters of the first name for each contact.
USE AdventureWorks2012; GO SELECT RIGHT(FirstName, 5) AS 'First Name' FROM Person.Person WHERE BusinessEntityID < 5 ORDER BY FirstName; GO
Here is the result set.
First Name ---------- Ken Terri berto Rob (4 row(s) affected)
