MidText

Extracts a string from another string based on adjoining strings

  • Free Function
  • SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017

Syntax:

SELECT SQLHTTP.net.MidText ( @Text, @Start, @End, @Index )

Arguments:

Name Type Description
@Text nvarchar(MAX)

String expression to extract from 

@Start nvarchar(MAX)

String preceding the substring to be retrieved 

@End nvarchar(MAX)

String proceeding the substring to be retrieved 

@Index smallint Integer value specifying the instance of a substring between Start and End

Return Type:

nvarchar(MAX)

Sample Usage:

Retrieving text surrounded by double brackets:

See Also: