SA0163B : Setting ANSI_PADDING to OFF is deprecated |
The topic describes the SA0163B analysis rule.
Setting ANSI_PADDING to OFF is deprecated
The rule checks T-SQL code for setting ANSI_PADDING or ANSI_DEFAULTS options set to OFF.
In a future version of Microsoft SQL Server ANSI_PADDING will always be ON and any applications that explicitly set the option to OFF will produce an error.
The setting of SET ANSI_PADDING is set at execute or run time and not at parse time.
To view the current setting for this setting, run the following query.
1DECLARE @ANSI_PADDING VARCHAR(3) = 'OFF'; 2IF ( (16 & @@OPTIONS) = 16 ) SET @ANSI_PADDING = 'ON'; 3SELECT @ANSI_PADDING AS ANSI_PADDING;
Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
The rule has a Batch scope and is applied only on the SQL script.
Rule has no parameters.
The rule does not need Analysis Context or SQL Connection.
Design Rules, Bugs
SQL
1ALTER DATABASE TestDb SET ANSI_NULLS OFF 2 3ALTER DATABASE TestDb SET ANSI_PADDING OFF 4 5ALTER DATABASE TestDb SET CONCAT_NULL_YIELDS_NULL OFF 6 7SET CONCAT_NULL_YIELDS_NULL OFF 8 9SET ANSI_PADDING ON 10 11SET CONCAT_NULL_YIELDS_NULL,ANSI_PADDING OFF 12 13SET ANSI_NULLS OFF 14 15SET ANSI_PADDING OFF 16 17SET CONCAT_NULL_YIELDS_NULL OFF 18 19SET ANSI_DEFAULTS OFF |
Message | Line | Column | |
---|---|---|---|
1 | SA0163B : Setting ANSI_PADDING to OFF is deprecated. | 3 | 26 |
2 | SA0163B : Setting ANSI_PADDING to OFF is deprecated. | 11 | 28 |
3 | SA0163B : Setting ANSI_PADDING to OFF is deprecated. | 15 | 4 |
4 | SA0163B : Setting ANSI_PADDING to OFF is deprecated. | 19 | 4 |