DF045: The DBCC command is used.
Last modified: May 28, 2025
The topic describes the DF045 T-SQL code analysis rule.
Category
DEPRECATED
Message
The DBCC command is used.
Description
The DBCC commands are deprecated. Use actual alternatives instead.
Additional information
The rule checks for the following commands:
- INDEXDEFRAG: Use the REBUILD option of ALTER INDEX instead.
- DBREINDEX: Rewrite the statement to use the REBUILD option of ALTER INDEX.
- CONCURRENCYVIOLATION: It no longer exists in SQL Server.
- SHOWCONTIG: Query sys.dm_db_index_physical_stats to get this information.
- OUTPUTBUFFER: It may require administrative privileges.
Noncompliant code example
DBCC DBREINDEX ('HumanResources.Employee', ' ', 70);
GO
Compliant solution
ALTER INDEX all ON HumanResources.Employee REBUILD
GO
Was this page helpful?
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.