SA0196 : Deprecated use of DROP INDEX with two-part index name syntax

The topic describes the SA0196 analysis rule.

Message

Deprecated use of DROP INDEX with two-part index name syntax

Description

The rule checks DROP INDEX statements for using the backward compatible syntax with two-part index name.

How to fix

The backward compatible syntax is deprecated and it is recommended to replace it with `index_name ON table_name` syntax.

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.

Effort To Fix
5 minutes per issue.
Categories

Design Rules, Deprecated Features, Bugs

Additional Information

There is no additional info for this rule.

Example Test SQL
SQL
1DROP INDEX Test.Greeting.IX_Greeting_GreetingId  
2
3DROP INDEX IX_Greeting_GreetingId ON Test.Greeting,  IX_Greeting_GreetingId ON Test.Greeting

Example Test SQL with Automatic Fix
SQL
1DROP INDEX IX_Greeting_GreetingId ON [Test].[Greeting];  
2
3DROP INDEX IX_Greeting_GreetingId ON Test.Greeting,  IX_Greeting_GreetingId ON Test.Greeting

Analysis Results
  Message Line Column
1 SA0196 : Deprecated use of DROP INDEX with two-part index name syntax. 2 0
See Also

Other Resources