In
this article I am going to explain sql server substring function.
In
previous article I have explained how to clean cache and buffer for sql serverstore procedure, Sql server STUFF function and Sql server CONCAT 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
|
0 Comments