WARDY IT Solutions - SQL Server Blog

SQLDMO to List SQL Server Configs

The SQLDMO Script below will list all of the SQL Server configuration options and their config_value and run_value just as per the sp_configure Stored Procedure:

Dim oSQLServer
Dim cv

Set oSQLServer = CreateObject("SQLDMO.SQLServer")

oSQLServer.LoginSecure = True
oSQLServer.Connect "(local)"

With oSQLServer.Configuration
    .ShowAdvancedOptions = True
    For Each cv In .ConfigValues
        Msgbox cv.Name & ", " & cv.RunningValue & ", " & cv.CurrentValue
    Next
End With

oSQLServer.DisConnect
Set oSQLServer = Nothing

Published Wednesday, April 27, 2005 10:00 AM by admin
Anonymous comments are disabled