T-SQL Functions that Work with Text and Image Data

T-SQL includes three functions that you can use to work with BLOB data.

Michael Otey

May 24, 2001

1 Min Read
ITPro Today logo in a gray background | ITPro Today

T-SQL includes ReadText(), WriteText(), and UpdateText() functions that you can use to work with the data that text, ntext, and image columns contain. However, unlike the much more powerful ADO Stream functions, these T-SQL functions are limited and somewhat cumbersome to use; they're more useful for text and ntext columns than for image data. Although you can use the T-SQL functions to manipulate binary data columns that exist in the database, you can't use them effectively to load binary data into the database. As the name suggests, you use the ReadText function to read data from a text, ntext, or image column. You use the WriteText function to write data to a text, ntext, or image column. The WriteText function always replaces all of a column's contents. With the UpdateText function, you can write data to a specific position in a text/Ntext/image column. This ability can be useful if you want to update just one part of a BLOB column.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like