I've seen many questions regarding the ANSI related settings, and read some docs that state some features (like indexes on computed columns and indexed views) can become worthless depending on ANSI settings on or off... So, what the recommended values for those:
- ANSI_Padding
- ANSI_NULLS
- ANSI_WARNINGS
- Concat_NULL_YELDS_NULL
- QUOTED_IDENTIFIER
- ARITHABORT
- NUMERIC_ROUNDABORT
I would like guidelines regarding those.
For indexed views and indexed or persisted computed columns the following
SET OPTIONSare all prescribedIn SQL Server 2005 setting
ANSI_WARNINGStoONimplicitly setsARITHABORTtoONunless the database compatibility level is set to 80 or earlier (when it needs to be set explicitly).Despite this it does make sense to be consistent in the
ARITHABORTsetting as this is used as a plan cache key and inconsistency can lead to duplicated plans wasting valuable plan cache space. You can see this from the query below.Even without the indexed view / persisted column requirements the
OFFsettings are deprecated for the following optionsANSI_PADDING,ANSI_NULLS,CONCAT_NULL_YIELDS_NULLand XQuery and XML data modification statements requires thatQUOTED_IDENTIFIERbeON.