Text and Image Manipulation

Text and image data consists of character or binary data stored and managed as a linked list of 2K data pages that appear as if they were stored in a table row. A text or image datatype contains a pointer (assigned at initialization) to the first data page or value fragment for that entry, and thus to the entire text or image value.

In SQL Server, this type of storage (variable number of 2K pages stored in a linked list) is fundamentally different from other datatypes. Because of this, text and image data is also manipulated differently. To assist in manipulating text and image data, SQL Server provides a variety of functions and statements. For more information on the text and image datatypes, see the Datatypes topic.

These are the text and image functions:

For details about these functions, see the Functions topic.

These are the text and image statements:

The following functions and statement are also useful with text and image data:

For information about PATINDEX and DATALENGTH, see the Functions topic. For information about the TEXTSIZE session setting, see the SET statement.

The following sections detail each of the text and image manipulation statements.