-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f00bcfc
commit 7d9ee15
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
-- | ||
-- Script to change the default locations to save the database files | ||
-- | ||
|
||
USE [master] | ||
GO | ||
|
||
-- Change default location for data files | ||
EXEC xp_instance_regwrite | ||
N'HKEY_LOCAL_MACHINE', | ||
N'Software\Microsoft\MSSQLServer\MSSQLServer', | ||
N'DefaultData', | ||
REG_SZ, | ||
N'E:\mssql_databases' | ||
GO | ||
|
||
-- Change default location for log files | ||
EXEC xp_instance_regwrite | ||
N'HKEY_LOCAL_MACHINE', | ||
N'Software\Microsoft\MSSQLServer\MSSQLServer', | ||
N'DefaultLog', | ||
REG_SZ, | ||
N'E:\mssql_databases\logs' | ||
GO | ||
|
||
-- Change default location for backups | ||
EXEC xp_instance_regwrite | ||
N'HKEY_LOCAL_MACHINE', | ||
N'Software\Microsoft\MSSQLServer\MSSQLServer', | ||
N'BackupDirectory', | ||
REG_SZ, | ||
N'E:\mssql_databases\backup' | ||
GO |