OC12
asked on
How to change the "Restore As" path to default to another location?
When restoring databases in SQL 2005, i have to manually change the path for the Data and the Log file to be stored on a seperate partition each time i do a restore. Is there a way that i can change the default location for this, so i dont have to do this manually every time?
Right now its defaulting to this location:
C:\Program Files\Microsoft SQL Server\MSSQL\Data
I want it to default to this location:
D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
Right now its defaulting to this location:
C:\Program Files\Microsoft SQL Server\MSSQL\Data
I want it to default to this location:
D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
restore dtabaes dbname
from disk = 'c:\bakup.bak'
with move
'logicaldatafilename' to 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ LogicalDat aFile.mdf' ,
move 'logicallogfilename' to 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ LogicalLog File.mdf',
recovery
from disk = 'c:\bakup.bak'
with move
'logicaldatafilename' to 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
move 'logicallogfilename' to 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
recovery
sorry..mistype
restore database dbname
from disk = 'c:\bakup.bak'
with move
'logicaldatafilename' to 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ LogicalDat aFile.mdf' ,
move 'logicallogfilename' to 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ LogicalLog File.mdf',
recovery
restore database dbname
from disk = 'c:\bakup.bak'
with move
'logicaldatafilename' to 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
move 'logicallogfilename' to 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
recovery
ASKER
I have about 5 users who do restores, i want to make this seemless for them so they dont have to manually type in the correct path. Is there some setting in SQL 2005 where i can specify this new location?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you have to specify it while restoring the db, as by default it will restore to the location from where the original file was backed up
GOD BLESS,
Aneesh R.