Right String Function In SQL Server 2008

In this article i will explain how to use the Right string function.
  • 3014

Introduction

Returns the rightmost part of a character string str with the given number of characters. LEFT string function takes 2 arguments.

Syntax

Right (string , length )

where,
string- String value (field name or expression) that will be used as input string.
length- Specifies the number of characters to obtain from the String you provided.

Example

Suppose we have table named Employee as.

Create-Table-in-sql.jpg

Returns the four rightmost characters of the first name for each employee.

right-function-example.jpg

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.