Sql server substring function

In this article I am going to explain sql server substring function.


Description:
Sql server substring function is used to get part of string from specified string. To get specified string we have to define starting position and length of string.

Syntax:
SUBSTRING (expression string ,start ,length)

Example:
Select SUBSTRING ('articledotnet' ,1 ,2) as [Substring] 
Output:

Substring
ar


Select SUBSTRING ('articledotnet' ,2 ,6)as [Substring]

Output:

Substring
rticle

Post a Comment

0 Comments