Restore Database from a Remote Backup
Good Day All
am restoring a Database Programatically in Sql. Now if the backup is located in the remote machine i use a Share
Quote:
\\Vuyiswa\MyShare\
but i will get the Following Error
Quote:
Exception caught in: ExecuteStoredProc: The file "\\Vuyiswa\Databases\\REmoteTest33.mdf" is on a network path that is not supported for database files. File 'TNGoedit_Data' cannot be restored to '\\Vuyiswa\Databases\\REmoteTest33.mdf'. Use WITH MOVE to identify a valid location for the file. The file "\\Vuyiswa\Databases\\REmoteTest33_log.ldf" is on a network path that is not supported for database files. File 'TNGoedit_Log' cannot be restored to '\\Vuyiswa\Databases\\REmoteTest33_log.ldf'. Use WITH MOVE to identify a valid location for the file. Problems were identified while planning for the RESTORE statement. Previous messages provide details. RESTORE DATABASE is terminating abnormally. Database 'REmoteTest33' does not exist. Make sure that the name is entered correctly.
Thanks
Re: Restore Database from a Remote Backup
I have never tried it with code, however you can try using the devices rather than directly giving the location. Something similar to this
Code:
USE master
GO
RESTORE DATABASE MYDATABASE FROM TAPE = '\\Vuyiswa\MyShare\'