locked
SQL Server 2012 SP2/Win2012 R2 defaultdata file location not showing in registry key RRS feed

  • Question

  • Hi,
    Installed SQL Server 2012 SP2 EE/Win 2012 R2 Server, defaultdata file location not able to see in registry keys. Is this bug, any one have this kind of experience?
    How can we resolve this kind of issue.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQLServer
    --Here not able to see the Defaultdata file locaiton, but able to see defaultlog file location.

    Thanks 
    Friday, January 15, 2016 2:57 AM

Answers

  • Hello,

    Why do you think it's stored in registry, is not? You can query the default data and log folder with

    select SERVERPROPERTY('instancedefaultdatapath') AS [DefaultFile],
           SERVERPROPERTY('instancedefaultlogpath') AS [DefaultLog]

    See SERVERPROPERTY (Transact-SQL)


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Friday, January 15, 2016 7:45 AM
  • Just to be clear:

    Are we talking about the *default* folder for database file?
    I.e., one entry for data file and another for log file?
    Do you see the registry entry for default folder for backup files?

    If we are indeed talking about the *default* location of database file, for new databases, then we are on the same page. :-)

    I see the very same thing. I have a vanilla installation of a default instance and I have a reg entry (in the same location as you posted) named BackupDirectory. But I do *not* have entries for database data or log files.

    As a test, I executed the command "CREATE DATABASE x". Note, I for this test didn't specify anything about the database files. And they ended up in the expected folder, \MSSQL\Data.

    So, it seems that the setup program doesn't create these registry entries unless you specify something different from default. I.e., by design. I always specify something else whenever I install SQL Server. But you can also change after an install using SSMS, right-click your instance, Property, Databases. And if you want to know the SQL commands for that, just script that GUI.


    Tibor Karaszi, SQL Server MVP | <a href="http://www.karaszi.com/sqlserver/default.asp"> web</a> | <a href="http://sqlblog.com/blogs/tibor_karaszi">blog</a>

    Friday, January 15, 2016 10:09 AM

All replies

  • Hi,

    Few questions

    1. SQL Server is up (which I guess is).

    2. Whether databases are up? Are you able to see the data and log files in DB properties screen?

    3. Can you run below query and share results?

    SELECT registry_key, value_name, value_data
    FROM sys.dm_server_registry
    WHERE registry_key like '%Parameter%'


    Regards Gursethi Blog: http://gursethi.blogspot.com/ ++++ Please mark "Propose As Answer" if my answer helped ++++

    Friday, January 15, 2016 5:12 AM
  • Hello,

    Why do you think it's stored in registry, is not? You can query the default data and log folder with

    select SERVERPROPERTY('instancedefaultdatapath') AS [DefaultFile],
           SERVERPROPERTY('instancedefaultlogpath') AS [DefaultLog]

    See SERVERPROPERTY (Transact-SQL)


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Friday, January 15, 2016 7:45 AM
  • Just to be clear:

    Are we talking about the *default* folder for database file?
    I.e., one entry for data file and another for log file?
    Do you see the registry entry for default folder for backup files?

    If we are indeed talking about the *default* location of database file, for new databases, then we are on the same page. :-)

    I see the very same thing. I have a vanilla installation of a default instance and I have a reg entry (in the same location as you posted) named BackupDirectory. But I do *not* have entries for database data or log files.

    As a test, I executed the command "CREATE DATABASE x". Note, I for this test didn't specify anything about the database files. And they ended up in the expected folder, \MSSQL\Data.

    So, it seems that the setup program doesn't create these registry entries unless you specify something different from default. I.e., by design. I always specify something else whenever I install SQL Server. But you can also change after an install using SSMS, right-click your instance, Property, Databases. And if you want to know the SQL commands for that, just script that GUI.


    Tibor Karaszi, SQL Server MVP | <a href="http://www.karaszi.com/sqlserver/default.asp"> web</a> | <a href="http://sqlblog.com/blogs/tibor_karaszi">blog</a>

    Friday, January 15, 2016 10:09 AM