Getting Started with ASP.NET MVC - Part 5: How to do programming with razor syntax
First Time? You can support us by signing up. It takes only 5 seconds. Click here to sign up. If you already have an account, click here to login.


Upload Image Close it
Select File

Nakul Vachhrajani is a Technical Specialist & Systems development professional with iGATE. He holds a MCTS (SQL Server 2008: Implementation & Maintenance)
Browse by Tags · View All
#SQLServer 133
SQL Server 132
Tips 120
Administration 120
Development 114
DBA 109
T-SQL 106
#TSQL 104
Best Practices 94
Tools and Utilities 87

Archive · View All
April 2011 14
March 2012 11
December 2011 11
March 2011 11
October 2011 10
January 2011 10
April 2012 9
January 2012 9
September 2011 9
August 2011 9

SSMS – CREATE/RESTORE Database wizard - Change the default database file path

Jun 20 2011 12:00AM by Nakul Vachhrajani   

Today’s post takes me back to the days when I was learning SQL Server at the engineering school about 8 years ago. I learnt SQL 7 and SQL 2000 and then as I joined my present employer, SQL 2005 came along. While SQL 7/2000 had the Enterprise Manager, SQL 2005 onwards we have the SSMS – SQL Server Management Studio. Irrespective of the tool, each of these had wizards for Creating and Restoring a database.

Whenever we create or restore a database, we can see that the SSMS fills in a default path for placing the data and log files. This path is set during the Server installation, and is normally set to %PROGRAMFILES%\Microsoft SQL Server\MSSQL11.(InstanceName)\MSSQL\DATA on a SQL 11 (Code Named: “Denali”) CTP 01 instance (Previous releases of SQL Server also follow a similar path).

Generally, I prefer to place the data and log files on a different physical drives whenever possible. I won’t go into the details of why I do this right now, but it is important to know that for most cases, it is a recommended best practice. It becomes an annoyance to change the data and log file paths every time I need to create or restore a database. Hence, I typically change the default file paths at the server instance level.

Here’s how you can do it yourself:

  1. Launch the SQL Server Management Studio
  2. Open the Object Explorer by going to View –> Object Explorer and connect to the SQL Server instance under consideration
  3. Right-click the instance name and click on “Properties”
  4. In the server properties window, navigate out to the Database Properties tab
  5. Change the Data & Log file paths under the “Database Default locations” section

image

Once changed, you can then see that these changes are used by default by the Create Database and Restore Database wizards. On my test instance, I don’t have multiple drives to spread the data/logs across, hence I have added the default locations as E:\Databases\Data for the data files and E:\Databases\Logs for the Log Files.

image

image

Until we meet next time,

Be courteous. Drive responsibly.

Tags: Administration, Tips, SQL Server, #SQLServer, Best Practices, Guidance, Installation, DBA, SSMS, Tools and Utilities,


Nakul Vachhrajani
6 · 26% · 5867
1
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"SSMS – CREATE/RESTORE Database wizard - Change the default database file path" rated 5 out of 5 by 1 readers
SSMS – CREATE/RESTORE Database wizard - Change the default database file path , 5.0 out of 5 based on 1 ratings
    Copyright © Beyondrelational.com Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising