Search code examples
sql-serverwindowsconfigurationregistrydatadirectory

What is SQL Server's SQLDataRoot Registry Value used for?


SQL Server creates this Registry Value during installation:

Key: HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\<instance>\Setup
Value: SQLDataRoot REG_SZ

In initially sets it to the folder above the default Data directory, e.g.,

C:\Program Files\Microsoft SQL Server\<instance>\MSSQL

It also appears in the SQL Configuration Manager (although not modifiable):

SQL Server Services->SQL Server->Properties->Advanced->Data Path

However SQL Server does not seem to actually use this Registry Value for anything. Changing it does not seem to affect where databases are created or attached from. Even changing it to an invalid path seems to not phase SQL Server. Does anyone know if it is used for anything and if so, what? Is it some legacy Value that is not used anymore?


Solution

  • The SQLDataRoot property identifies the default operating-system directory implementing storage for Microsoft SQL Server system user-defined databases.

    I think that is used when you execute install .msi file for repair, delete or install something where needs this path.

    In this link you have definition

    hope this help!