Click or drag to resize

SA0222 : The ALTER LOGIN WITH SET CREDENTIAL or ALTER LOGIN WITH NO CREDENTIAL syntax is deprecated

The topic describes the SA0222 analysis rule.

Message

The ALTER LOGIN WITH SET CREDENTIAL or ALTER LOGIN WITH NO CREDENTIAL syntax is deprecated

Description

The rule check T-SQL code for the deprecated feature syntax ALTER LOGIN WITH SET CREDENTIAL or NO CREDENTIAL.

It is recommended to use the ALTER LOGIN ADD/DROP CREDENTIAL syntax 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
1ALTER LOGIN Joe2 WITH CREDENTIAL = Custodian04;
2ALTER LOGIN Joe2 WITH NO CREDENTIAL
3
4ALTER LOGIN Joe2 ADD CREDENTIAL Custodian04; 
5ALTER LOGIN Joe2 DROP CREDENTIAL Custodian04;

Analysis Results

 MessageLineColumn
1SA0222 : The ALTER LOGIN WITH SET CREDENTIAL or ALTER LOGIN WITH NO CREDENTIAL syntax is deprecated.117
2SA0222 : The ALTER LOGIN WITH SET CREDENTIAL or ALTER LOGIN WITH NO CREDENTIAL syntax is deprecated.217
See Also

Other Resources