Click or drag to resize

SA0213 : The DBCC command is deprecated

The topic describes the SA0213 analysis rule.

Message

The DBCC command is deprecated

Description

The rule checks T-SQL code for usages of deprecated DBCC commands.

The deprecated DBCC commands are the following:

- DBCC DBREINDEX

- DBCC INDEXDEFRAG

- DBCC SHOWCONTIG

- DBCC PINTABLE

- DBCC UNPINTABLE

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
1DBCC DBREINDEX ('HumanResources.Employee', PK_Employee_BusinessEntityID,80);  
2DBCC DBREINDEX ('HumanResources.Employee', ' ', 70);  
3DBCC INDEXDEFRAG (AdventureWorks2012, 'Production.Product', PK_Product_ProductID);  
4
5DBCC SHOWCONTIG ('HumanResources.Employee');  
6DBCC PINTABLE ( 12 , 12 )
7DBCC UNPINTABLE ( 12 , 33 )
8DBCC HELP ('CHECKDB')

Analysis Results

 MessageLineColumn
1SA0213 : The DBCC DBREINDEX command is deprecated. Use ALTER INDEX instead.15
2SA0213 : The DBCC DBREINDEX command is deprecated. Use ALTER INDEX instead.25
3SA0213 : The DBCC INDEXDEFRAG command is deprecated. Use ALTER INDEX instead.35
4SA0213 : The DBCC SHOWCONTIG command is deprecated. Use sys.dm_db_index_physical_stats instead.55
5SA0213 : The DBCC PINTABLE command is deprecated. The command has no effect and its usages should be removed.65
6SA0213 : The DBCC UNPINTABLE command is deprecated. The command has no effect and its usages should be removed.75
See Also

Other Resources