In this post , I will explain the SUBSTRING function of SQL Server of string functions category.
In my previous posts, I explained UPPER Function, STUFF Function, LEN Function, UNICODE Function, LEFT Function, CHARINDEX Function, CHAR Function, ASCII Function and some other articles related to SQL Server.
Here, I am going to explain SUBSTRING function of SQL Server.
In my previous posts, I explained UPPER Function, STUFF Function, LEN Function, UNICODE Function, LEFT Function, CHARINDEX Function, CHAR Function, ASCII Function and some other articles related to SQL Server.
Here, I am going to explain SUBSTRING function of SQL Server.
SUBSTRING() Function
This function is used to get the part of the character, binary, text or image expression.
Syntax- SUBSTRING(expression, start, length)
Arguments-
Arguments-
- expression : An expression of character string, binary string, text.
- start : An integer value which specified the start position of substring.
- length : An positive integer value which specified how many characters or bytes of the expression will be returned.If length is negative, an error is occurred.
Example-
Declare @nstring varchar(50)
set @nstring='Dot Net World'
select SubString(@nstring, 2,6)
--OutPut ot Net
Declare @nstring varchar(50)
set @nstring='Dot Net World'
select SubString(@nstring, 3,5)
--OutPut t Net
Great post. All readers will definitely like this post. Looking forward for your next post.
ReplyDelete