Using Text and Image Data

Microsoft® SQL Server™ stores character strings longer than 8,000 characters and binary data longer than 8,000 bytes in special data types named text and image. Unicode strings longer than 4,000 characters are stored in the ntext data type.

For example, a large text file (.txt) of customer information must be imported into your SQL Server database. You want this data stored as one piece of data rather than integrated into the multiple columns of your data tables. You can create a column with the text data type for this purpose. However, if you must store company logos currently stored as TIFF images (.tif) that are 10 KB each, create a column with the image data type.

If the textual data to be stored is in Unicode format, use the ntext data type. For example, a form letter created for international customers is likely to contain international spellings and characters used in various different cultures. Store this data in an ntext column.

text data is interpreted by SQL Server as a series of characters using the code page installed with SQL Server. ntext data is interpreted by SQL Server as a series of characters using the Unicode specification.

Data in an image data is stored as a string of bits and is not interpreted by SQL Server. Any interpretation of the data in an image column must be made by the application. For example, an application could store data in an image column using a BMP, TIFF, GIF, or JPEG format. It is up to any application that reads the data from the image column to recognize the format of the data and display it correctly. All an image column does is provide a location to store the stream of bits that make up the image data value.

See Also
Data Types Character Data

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.