How can I set "Database Default Location" during unattended sql server installation

  • hi,

    Is there a way to set "Database Default Location" during unattended sql server installation ?

    (Database Default location can be displayed in "Database settings" in Server Properties)


    Kindest Regards,

    egpotus DBA

  • You have to use the INSTALLSQLDATADIR parameter. Problem is that this will only accept one directory for data and log files.

    In case you want to have separate loctions for data and log I would advise run a post install script.

    For Datafiles:

    EXEC master..xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer',N'DefaultData', REG_SZ,'D:\MSSQL.1\MSSQL\DATA\'

    For Logfiles:

    EXEC master..xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer',N'DefaultLog', REG_SZ,'E:\MSSQL.1\MSSQL\LOG\'

    [font="Verdana"]Markus Bohse[/font]

  • thank you


    Kindest Regards,

    egpotus DBA

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply