• TomThomson (12/29/2015)


    SQLRNNR (12/29/2015)


    TomThomson (12/29/2015)


    Quite a nice question, but why involve PowerShell?

    I was wondering that myself. It is easy enough to get a list of the configs from a simple select statement, unless the SMO is revealing a setting that the sql statement would not.

    Well, SP_CONFIGURE (without parameters) will display only the settings that don't require 'show advanced options' to be 1; so in SQL server 14 it will show only 18 of the 70 options unless show advanced options is on. The SMO object contains all the options, and Steve's SMO shows the whole object.

    In addition, the SMO object has 9 attributes per option intead of just 5; the 4 missing from SP_CONFIGURE output are the Option Number (these are not a dense set, but I've found them useful because they are not as big as the names), whether the option is advanced or not, whether the option requires an instance restart to change or not, and a plain English explanation of what the option is (maybe useful when the display name is a bit opaque, but I've never had a use for it). I've never bothered to find out how to get these additional columns in SQL because it wasnt in SQL that I needed them - but I can see it being a simple select statement as you suggest.

    for Steve : a nice question which was an easy one as I have studied deeply SMO ( and Configuration.Properties especially )

    For Tom : you are absolutely right. If a person tries to find the good answer , it is impossible except if he/she has used SMO and especially Smo.Configuration ( which has the same number of properties than sp_configure has possibilities of options to configure ). Be careful anyway , as I am not sure that SMO accept all the new possibilities provided by SQL Server 2016 , there is always a little latency in the reactivity of the team maintaining the SMO libraries...

    I am often grumbling against you because of your style of writing not always easy to understand ( I am a poor old french man reading the English language in a difficult way and my written English is an horror ) but , your explanation is easy to understand and full. Cheers to you...