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

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

Syntax

sp_drv_textlocator_charindex search_locator, locator, start, position

Input Parameters

  • search_locator – a text_locator that points to the literal 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 the literal in the LOB column referenced by locator.

Result Set

None.