SQL Server: RIGHT String Functions in SQL Server



RIGHT: This function use when we want to select a Right part of the character string with the specified number of characters.

Syntax:

RIGHT ( character_expression , integer_expression )

character_expression: Character expression is the expression of character or binary data, except text or ntext, character_expression can be of any data type.

integer_expression: integer_expression is a positive integer that specifies how many characters of the character_expression will return.

For example: 
DECLARE @str VARCHAR(60) 
SET @str='dilip Kumar Singh' 
select RIGHT(@str,5) AS RightFiveChar 
Result:

RightFiveChar
-------------
Singh
(1 row(s) affected)


Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...