November 10, 2011 at 4:18 am
I have .bak (full backup) for database name as 'Sales' in my c:\backup..
I want to restore the database with new name as 'Per_Sales' from the .bak of Sales database
when i query restore database Per_sales from disk='c:\backup' ---which gives
Msg 1834, Level 16, State 1, Line 1
The file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\rekha.mdf' cannot be overwritten. It is being used by database 'rekha'.
Msg 3156, Level 16, State 4, Line 1
File 'rekha' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\rekha.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 1834, Level 16, State 1, Line 1
The file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\rekha_log.LDF' cannot be overwritten. It is being used by database 'rekha'.
Msg 3156, Level 16, State 4, Line 1
File 'rekha_log' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\rekha_log.LDF'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
November 10, 2011 at 4:24 am
The error message tells you what you need to know. You can't use the same physical files for a different database. You have to specify new files.
John
November 10, 2011 at 4:41 am
Thanks john...i have changed my physical names ...it's working fine now
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply