Why is SQL Server deprecating SET ANSI_PADDING OFF?

孤街浪徒 提交于 2020-01-13 08:24:06

问题


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?


回答1:


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.)




回答2:


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.



来源:https://stackoverflow.com/questions/1415726/why-is-sql-server-deprecating-set-ansi-padding-off

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!