Click or drag to resize

SA0053B : Don’t use deprecated TEXT,NTEXT and IMAGE data types. (Batch)

The topic describes the SA0053B analysis rule.

Message

Don’t use deprecated TEXT,NTEXT and IMAGE data types. (Batch)

Description

The data types ntext, text, and image will be removed in a future version of Microsoft SQL Server.

Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.

Scope

The rule has a Batch scope and is applied only on the SQL script.

Parameters

Rule has no parameters.

Remarks

The rule does not need Analysis Context or SQL Connection.

Categories

Design Rules

Additional Information

There is no additional info for this rule.

Example Test Script
 1CREATE TABLE [dbo].[Person]
 2( 
 3    [Title]  [nvarchar]( 8 ) NULL
 4  , [FirstName]  [dbo].[Name] NOT NULL
 5  , [MiddleName]  [dbo].[Name] NULL
 6  , [LastName]  [dbo].[Name] NOT NULL
 7  , [Picture] IMAGE NULL                         -- varbinary(max) can be used instead image data type
 8  , [Description] TEXT NULL                 -- varchar(max) can be used instead image data type
 9  , [UnicodeDescription] [NTEXT] NULL -- nvarchar(max) can be used instead image data type
10);
11
12DECLARE  @desc AS TEXT                                 -- nvarchar(max) can be used instead image data type

Analysis Results

 MessageLineColumn
1SA0053B : Consider using VARBINARY(MAX) instead of deprecated data type IMAGE.714
2SA0053B : Consider using VARCHAR(MAX) instead of deprecated data type TEXT.818
3SA0053B : Consider using NVARCHAR(MAX) instead of deprecated data type NTEXT.925
4SA0053B : Consider using VARCHAR(MAX) instead of deprecated data type TEXT.1218
See Also

Other Resources