Click or drag to resize

SA0226 : The usage of ROWGUIDCOL and IDENTITYCOL as column name in DML statements is deprecated

The topic describes the SA0226 analysis rule.

Message

The usage of ROWGUIDCOL and IDENTITYCOL as column name in DML statements is deprecated

Description

The rule checks T-SQL code for DML statements, which refer rowguid and identity columns using ROWGUIDCOL and IDENTITYCOL names.

The ROWGUIDCOL and IDENTITYCOL names are deprecated and it is recommended to use the $identity and $rowguid 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

New Rules, Deprecated Features

Additional Information
Example Test Script
SQL
1declare @table as table(id  uniqueidentifier  ROWGUIDCOL, id2  int IDENTITY(1,1))
2
3select rowguidcol, identitycol from @table
4
5select $rowguid, $identity from @table

Analysis Results

 MessageLineColumn
1SA0226 : The use of ROWGUIDCOL as column name in DML statements is deprecated. Use $rowguid instead.37
2SA0226 : The use of IDENTITYCOL as column name in DML statements is deprecated. Use $identity instead.319
See Also

Other Resources