MidTextCount
Returns the highest available Index that can be used using the MidText function
- Free Function
- SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017
SELECT SQLHTTP.net.MidTextCount ( @Text, @Start, @End )
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 |
int
Retrieving text surrounded by double brackets:
1 2 3 4 5 6 7 8 9 10 11 |
DECLARE @Text nvarchar(MAX) DECLARE @Start nvarchar(MAX) DECLARE @End nvarchar(MAX) SET @Text = '[[some]] of these [[words]] are in [[double brackets]]' SET @Start = '[[' SET @End = ']]' SELECT SQLHTTP.net.MidTextCount(@Text, @Start, @End) |
1 2 3 4 5 |
----- 3 |