Finding Position of a Search String within the Text Column Referenced by a Locator

Use sp_drv_varchar_charindex, which accesses the Transact-SQL function charindex.

Syntax

sp_drv_varchar_charindex search_string, locator, start, position

Input Parameters

  • search_string – the literal, of type varchar, to search for.

  • locator – a text_locator that references the text column to search from.

  • start – an integer specifying the position from which to begin searching. The first position is 1.

Output Parameters

position – an integer specifying the starting position of search_string in the LOB column referenced by locator.

Result Set

None.