Click or drag to resize

SA0227 : The TIMESTAMP syntax is deprecated, use ROWVERSION instead

The topic describes the SA0227 analysis rule.

Message

The TIMESTAMP syntax is deprecated, use ROWVERSION instead

Description

The rule checks T-SQL code for ALTER TABLE and CREATE TABLE statements, which use the deprecated TIMESTAMP syntax to add a timestamp column.

The timestamp syntax 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.

The T-SQL timestamp data type is different from the timestamp data type defined in the ISO standard. It is a synonym for the rowversion data type and is subject to the behavior of data type synonyms.

In DDL statements, use rowversion instead of timestamp wherever possible.

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
1CREATE TABLE ExampleTable1 (PriKey int PRIMARY KEY, timestamp); 
2ALTER TABLE ExampleTable2 ADD Timestamp
3
4CREATE TABLE ExampleTable3 (PriKey int PRIMARY KEY, VerCol rowversion) ;  
5ALTER TABLE ExampleTable4 ADD VerCol Rowversion NOT NULL
6ALTER TABLE ExampleTable5 ADD VerCol Timestamp

Analysis Results

 MessageLineColumn
1SA0227 : The TIMESTAMP syntax is deprecated, use ROWVERSION instead.252
2SA0227 : The TIMESTAMP syntax is deprecated, use ROWVERSION instead.330
See Also

Other Resources