SA0053B : Don’t use deprecated TEXT,NTEXT and IMAGE data types

The topic describes the SA0053B analysis rule.

Message

Don’t use deprecated TEXT,NTEXT and IMAGE data types

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, Deprecated Features, Bugs

Additional Information

There is no additional info for this rule.

Example Test Script
SQL
 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

  Message Line Column
1 SA0053B : Consider using VARBINARY(MAX) instead of deprecated data type IMAGE. 7 14
2 SA0053B : Consider using VARCHAR(MAX) instead of deprecated data type TEXT. 8 18
3 SA0053B : Consider using NVARCHAR(MAX) instead of deprecated data type NTEXT. 9 25
4 SA0053B : Consider using VARCHAR(MAX) instead of deprecated data type TEXT. 12 18
See Also

Other Resources