all groups > sql server programming > september 2007 >
You're in the

sql server programming

group:

Errors (Msg 5133, Level 16, State 1, Line 1)


Errors (Msg 5133, Level 16, State 1, Line 1) Lam Nguyen
9/11/2007 8:14:00 PM
sql server programming:
I am try to restore a database from external hard drive and I am get the
errors below. Do you have any ideas how to resolve these errors?. Thank you
in advance.

Errors:
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "E:\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\SCData_prosum.mdf" failed with the operating system
error 3(The system cannot find the path specified.).
Msg 3156, Level 16, State 3, Line 1
File 'SCData_prosum' cannot be restored to 'E:\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\SCData_prosum.mdf'. 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.


-- Create databse file under: c:\mssql\data\...
c\msssql\Log\.....


-- Here is my script try to restore the database.

EXECute Master.dbo.sp_dboption 'SCData_prosum', 'Single', True
GO
PRINT 'Begin restore SCData_prosum database, please wait...'
RESTORE DATABASE SCData_prosum
FROM DISK =
'C:\MSSQL\Backup\SCData_Prosum\SCData_prosum_backup_200709061759.bak'
WITH REPLACE,
RECOVERY,
STATS = 10
GO
EXECute Master.dbo.sp_dboption 'SCData_prosum', 'Single', False
GO
Re: Errors (Msg 5133, Level 16, State 1, Line 1) vijay
9/12/2007 12:00:00 AM
On Sep 12, 8:14 am, Lam Nguyen <LamNgu...@discussions.microsoft.com>
[quoted text, click to view]

Are you restoring database copy from another server ? Check whether
the drive & folder locations are same as it was earlier during backup
or try restoring using with move option so the files can be created in
the folder location you want .

RESTORE DATABASE TestDB
FROM DISK = 'c:\Northwind.bak'
WITH MOVE 'Northwind' TO 'c:\test\testdb.mdf',
MOVE 'Northwind_log' TO 'c:\test\testdb.ldf'
GO

Thanks
Vijayasekar
AddThis Social Bookmark Button