Click or drag to resize

SA0156 : Statements CREATE/DROP DEFAULT are deprecated. Use DEFAULT keyword in CREATE/ALTER TABLE

The topic describes the SA0156 analysis rule.

Message

Statements CREATE/DROP DEFAULT are deprecated. Use DEFAULT keyword in CREATE/ALTER TABLE

Description

The rule checks for usage of the deprecated CREATE/DROP DEFAULT statements.

This feature will be removed in a future version of Microsoft SQL Server.

Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

Instead, use default definitions created using the DEFAULT keyword of ALTER TABLE or CREATE TABLE.

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

Design Rules

Additional Information
Example Test Script
1--DROP DEFAULT  phonedflt;
2CREATE DEFAULT phonedflt AS 'unknown';

Analysis Results

 MessageLineColumn
1SA0156 : Deprecated CREATE/DROP DEFAULT statement. Use DEFAULT keyword in CREATE/ALTER TABLE.21
See Also

Other Resources