Sql-server – SQL Server Command Line install – Default database directories

installationsql-server-2016system-databases

Is there any way using the Command Line install method, I can specify a custom location for the system databases?

I want them to be in D:\SqlServer\Data

or is this only way to do this to install them in the default directory and then move them after?

Best Answer

Yes you can do this. Best way to do is use the configuration.ini file and customise it as per your use.

For system datafiles you will need to edit this portion of the file : INSTALLSQLDATADIR="S:"

ABove example is where my system datafiles go into.. (S: )