• Hi, this script is a great idea and does exactly what I needed to document some server settings before I apply a change to default data and log values.

    I have found a small bug in the script. If the DefaultData value is set but the DefaultLog is not set then the DefaultLog is displayed as the DefaultData value rather than the SQLDataRoot value. This is because the @path variable is no longer null going into the xp_instance_regread for the DefaultLog value. The xp does not find the value for DefaultLog as it is not set, and therefore does not alter the value in @path, but @path is not null as it contains the value from DefaultData set previously.

    To fix this I just added a SET @path = NULL before each call to xp_instance_regread

    Thanks again.