Convert the Locator Value to the LOB Value

After using a locator in a Transact-SQL statement, you can convert (dereference) the locator to the corresponding LOB.

To explicitly convert a locator, use the return_lob function. For example, to return the LOB value for @w, enter:
declare @w text_locator

select return_lob(text, @w)
You can also implicitly convert the locator. For example, to insert the actual LOB value for @w into the textcol column of my_table, enter:
insert my_table(textcol) values (@w)

The return_lob command overrides the set sent_locator on command. return_lob always returns the LOB.

Parameter Markers

You can explicitly convert a locator when using parameter markers in Transact-SQL statements. For example:
insert my_table (textcol)) values(return_lob(text,?))

Use the locator_literal function to identify the locator:

insert my_table (imagecol) values (locator_literal(image_locator, binary_locator_value))