Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server 2000 Backup to Network Drive

Status
Not open for further replies.

NickCorlett

Technical User
May 23, 2002
71
GB
I have been through the forum and read the previous threads on this subject, but am still unable to backup over our network.

I am executing the following code through an SQL Query Analyzer window

"BACKUP DATABASE msdb TO DISK='\\myserver\myshare\Test.bak' WITH INIT"

I get the following error
"Server: Msg 3201, Level 16, State 1, Line 1
Cannot open backup device '\\myserver\myshare\Test.bak'. Device error or device off-line. See the SQL Server error log for more details.
Server: Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally"

I am running this as an Domain Administrator account which has full rights to both the directory and share.

Any help would be appreciated.
 
First you need to create a
\\myserver\myshare\Test.bak at you destination. Thats why you get the error.
Here is an example

[tt]
use master
declare @exists int
@exists=select count(*) from master.dbo.sysdevices where name ='MyDb'
if @exists <>0
begin
sp_dropdevice 'mydiskdump'
end
EXEC
GO
sp_addumpdevice 'disk', 'mydiskdump', 'c:\dump\dump1.bak'
GO
BACKUP DATABASE ......
[/tt]
--
--Now proceed with BACKUP DATABASE

Dr.Sql
Good Luck.
 
Thanks it works a treat, don't understand what is different other thank creating it through SQL rather than the GUI?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top