SQL Server 2012 SP2/Win2012 R2 defaultdata file location not showing in registry key
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
If you're on SQL 2012 or above you can get these paths from new server properties: select InstanceDefaultDataPath = serverproperty('InstanceDefaultDataPath'), InstanceDefaultLogPath = serverproperty('InstanceDefaultLogPath') Happycat's theory is quite plausible so I'd be interested to know what these return on your system. It would be better if there was a reliable registry entry fr the path, even if you haven't changed it from the default value.
Yes - the serverproperty query from David is right way to get this info. SQL gets the info either from the registry or derived from the location of the master (I think) and returns the correct values as per David's query. You should have no need to check what is in the registry Using David's select statement returns the correct values from my system (although I think there was an issue with the correct values that disappeared when I restarted SQL. The old value was being shown instead of the new value. Not sure whether this was me or SQL ... I was a little distracted at the time)