textptr

Returns a pointer to the first page of a text, image, or unitext column.

Syntax

textptr(column_name)

Parameters

Examples

Usage

  • textptr, a text and image function, returns the text pointer value, a 16-byte varbinary value.

  • The textptr value returned for an in-row LOB column residing in a data-only-locking data row that is row-forwarded remains unchanged and valid after the forwarding.

  • If a text, unitext, or image column has not been initialized by a non-null insert or by any update statement, textptr returns a NULL pointer. Use textvalid to check whether a text pointer exists. You cannot use writetext or readtext without a valid text pointer.

Note: Trailing f in varbinary values are truncated when they are stored in tables. If storing text pointer values in a table, use binary as the column’s datatype.

See also Transact-SQL Users Guide.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute textptr.

Related concepts
text, image, and unitext Datatypes
Related reference
textvalid