What Is SUBSTRING In SQL Server, Example Of SUBSTRING Function In SQL

What Is SUBSTRING In SQL Server, Example Of SUBSTRING Function In SQL

In this tutorial i will explain you what is SUBSTRING function in SQL Server.SUBSTRING function returns part of a character, binary, text, or image expression.We use SUBSTRING to split the string and get only some part of it.

Syntax:-

SUBSTRING expression , start , length )

1. Expression:- Is a character string, binary string, text, image, a column, or an expression that includes a column. Do not use expressions that include aggregate functions.

2. Start:- Is an integer that specifies where the substring begins.

3. Length:-Is a positive integer that specifies how many characters or bytes of the expression will be returned. If length is negative, an error is returned.

Example:-

substring in sql server