Tuesday, 13 August 2013

Restoring database by specifying network path for a local pc

Restoring database by specifying network path for a local pc

I am using sql server 2008 r2. When i try to restore the database by using
restore command
RESTORE DATABASE [dbname] FROM DISK = N'\\PC91\D\backup.BAK' WITH FILE =
1, MOVE N'test' TO N'\\PC91\D\dbname.MDF', MOVE N'test_log' TO
N'\\PC91\D\dbname_log.LDF', NOUNLOAD, STATS = 10
I get error like
Msg 3634, Level 16, State 1, Line 1
The operating system returned the error '5(Access is denied.)' while
attempting 'CreateFileW' on '\\PC91\D\dbname.MDF'.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Here in above code i use network path,But this network path is for My pc
where sql server exists. why does this error comes?

No comments:

Post a Comment