Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is SQL Server deprecating SET ANSI_PADDING OFF?

According to MSDN BOL (Books Online) on SET ANSI_PADDING,

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. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

I have never used this option but it looks like it can actually save a lot of database spaces for char and varbinary fields if used correctly.

Why is SET ANSI_PADDING becoming obsolete, other than the fact that it is not ANSI-compliant?

Are there any good reasons why?

like image 244
dance2die Avatar asked Sep 12 '09 17:09

dance2die


2 Answers

Not an answer, just an opinion:

I personally would like to believe they're removing it because it's a nulling pain in the null. If one database object is created, used, referenced, or whatever with it ON, a second one is done so with it OFF, and you try to work with both at the same time (two tables, procedure referencing table, etc.), your results may be inconsistant or may not make sense, and it will take you Forever to figure out what's going on.

(There are other SET settings like this, and worse. I hope they deprecate them all.)

like image 84
Philip Kelley Avatar answered Oct 13 '22 16:10

Philip Kelley


That feature wasn't used at all and it isn't ANSI compliant also, so they will remove it. The space saving on can be done regardless of ansi_padding, sql server can remove the padding internally.

like image 43
Pop Catalin Avatar answered Oct 13 '22 18:10

Pop Catalin