Click or drag to resize

SA0201 : Textpointers statements WRITETEXT, UPDATETEXT and READTEXT are deprecated

The topic describes the SA0201 analysis rule.

Message

Textpointers statements WRITETEXT, UPDATETEXT and READTEXT are deprecated

Description

The rule checks for usages of the deprecated textpointer statements WRITETEXT, UPDATETEXT and READTEXT.

This feature is in maintenance mode and may be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

Use the large-value data types and the .WRITE clause of the UPDATE statement instead as alternative to the textpointer statements.

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

New Rules, Deprecated Features

Additional Information
Example Test Script
SQL
 1DECLARE @ptrval binary(16);  
 2SELECT @ptrval = TEXTPTR(pr_info)   
 3FROM pub_info pr, publishers p  
 4WHERE p.pub_id = pr.pub_id   
 5   AND p.pub_name = 'New Moon Books'  
 6WRITETEXT pub_info.pr_info @ptrval 'New Moon Books (NMB) has just released another top ten publication. With the latest publication this makes NMB the hottest new publisher of the year!'; 
 7UPDATETEXT pub_info.pr_info @ptrval 88 1 'b';  
 8READTEXT pub_info.pr_info @ptrval 1 25;  
 9
10UPDATE pub_info SET pr_info .WRITE (N'test',28,10)

Analysis Results

 MessageLineColumn
1SA0201 : Textpointers statements WRITETEXT, UPDATETEXT and READTEXT are deprecated.60
2SA0201 : Textpointers statements WRITETEXT, UPDATETEXT and READTEXT are deprecated.70
3SA0201 : Textpointers statements WRITETEXT, UPDATETEXT and READTEXT are deprecated.80
See Also

Other Resources