• L' Eomot Inversé (10/8/2012)


    (i) these are the server defaults for those settings

    But server defaults can be changed. Not that there is much in doing so (read on!), but it can be done. If you write code that should work on servers outside your direct control, it's better not to rely on any defaults at all.

    (ii) I tend to do unit testing in SSMS, where my connection automatically uses the server defaults, so I don't need to make these settings

    You may use SSMS, but not everyone does.

    However, much more important - your statement is incorrect. SSMS does not use the server defaults. If you run a profiler or XEvents trace while working in SSMS, you'll see that each connection emits a series of SET statements when it's opened. These settings are controlled in the Tools / Options / Query Execution / SQL Server / Advanced and ANSI dialogs for new query windows, or in the Query / Query Options / Advanced and ANSI dialogs for already opened query windows. I'm not even sure if all settings are exposed through these dialogs.

    If you connect using sqlcmd.exe, you'll see that this tool, too, emits a series of SET options. And they are different from the default options used by SSMS.

    So when executing code, the actual options in effect depend upon the tool used (and possibly changes made to that tool's default settings), rather than the server defaults.

    (vi) I'm looking forward to the day when most of these options will be impossible to change from the default values (most are already depreciated) and the rest will have the server defaults as the defaults for all connections.

    Ah yes. I am waiting for that day as well!


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/