Search
  Home
  Articles
  Backup
  Books
  Certification
  FAQ
  Products
  Replication
  Scripts
  Seminars
  Training
  TSQL

MSDN Fourms
Philippine SSUG

  Resume

MHS Enterprises
FilAm Software
AcrylicAcetate.com
Bargain Humidors
Western Humidor



How can I change the default location for database files that SQL creates?

Change/add the following registry keys :-

KEY: HKLM\Software\Microsoft\MSSQLServer\MSSQLServer
VALUE: DefaultData
VALUE: DefaultLog

Just put in a directory name (no trailing backslash) for these.

This works only for databases that you create with the CREATE DATABASE statement, not for databases created from Enterprise Manager.

(Answer courtesy of Kalen Delaney)  

Michael R. Hotek

All content on this site, except where noted, represents an original work of Michael R. Hotek and is protected by applicable copyright laws. The SQL Server FAQ is the sole work of Neil Pike. No page, portion of a page, or download may be used for commercial purposes in whole or in part without the express, written permission of the applicable author.