This may be useful if you have want to view or change the default location of the database files on an installed instance.
View or change the default locations for database files
- In Object Explorer, right-click on your server and click Properties.
- In the left panel on that Properties page, click the Database settings tab.
- In Database default locations, view the current default locations for new data files and new log files. To change a default location, enter a new default pathname in the Data or Log field, or click the browse button to find and select a pathname.
NOTE: After changing the default locations, you must stop and start the SQL Server service to complete the change.
Validate the current location
SELECT DataPath = CONVERT(sysname, SERVERPROPERTY(‘InstanceDefaultDataPath’)), LogPath = CONVERT(sysname, SERVERPROPERTY(‘InstanceDefaultLogPath’));
View or change the default Backup locations for database
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.\MSSQLServer]
“BackupDirectory”=”D:\SQLBackup”