Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't save database default locations in SQL Server

I'm trying to change the default directories for data and logs using SQL Server Management Studio. I change the path then click ok but it always reverts back to the old directory in Program Files. Anyone else seen this bug? I'm using SQL Server 2012 Standard.

I do see that the correct values are saved in the registry, but they aren't being obeyed by the studio or other connecting applications that would create new databases.

like image 955
jb_bryant Avatar asked Sep 27 '14 03:09

jb_bryant


People also ask

How do I save a SQL database path?

If it's a text file, then you could use File. ReadAllText() to get a string that you can save in your database. If it's not a text file, then you could use File. ReadAllBytes() to get the file's binary data, and then save that to your database.

Where is the default location for SQL database?

The default database file location for server instances depends on the version of the Microsoft SQL Server software: SQL Server 2014 — C:\Program Files\Microsoft SQL Server\MSSQL12. MSSQLSERVER\MSSQL\DATA\ SQL Server 2016 — C:\Program Files\Microsoft SQL Server\MSSQL13.


1 Answers

According to Microsoft, you must restart the SQL Server service for this to take effect.

You can do this easily via the Configuration Manager, or via the services.msc snap-in if you prefer that.

like image 137
md4 Avatar answered Oct 27 '22 02:10

md4