Hi there,
I'm running this script:
declare @v_filename varchar(100),
@vbackupdevice varchar(100),
@v_error int,
@p_database varchar(100),
@p_dest1 varchar (1000)
set @p_dest1 = 'd:\dbbackup\NW\'
set @p_database = 'Northwind'
set @v_filename = @p_dest1 + '\Northwind' +
convert(varchar(20),getdate(), 112) + '_' + convert(varchar(20),
getdate(), 108)
+ '_full'
set @vbackupdevice = @v_filename
select @v_filename
select @vbackupdevice
if exists (select 'x' from master..sysdevices where name =
@vbackupdevice)
exec sp_dropdevice @vbackupdevice
EXEC @v_error = master..sp_addumpdevice 'disk', @vbackupdevice,
@v_filename
BACKUP DATABASE @p_database TO @vbackupdevice WITH INIT, NAME =
@p_database, NOSKIP , STATS = 10, DESCRIPTION = @v_filename, NOFORMAT
After I run this script I receive the following message:
'Disk' device added.
Server: Msg 3201, Level 16, State 1, Line 22
Cannot open backup device
'd:\dbbackup\NW\\Northwind20031203_17:05:11_full'. Device error or
device off-line. See the SQL Server error log for more details.
Server: Msg 3013, Level 16, State 1, Line 22
Consequently the backup fails. However, when I look at the
Backupdevices, there it is, exactly as printed in the errormessage. What
could be the cause of this? Should I end the CREATEDEVICE with a GO?
Which poses other problems, for this script is supposed to be part of a
SP.
Any comments welcome.
Tnx,
Hans Brouwer
I'm running this script:
declare @v_filename varchar(100),
@vbackupdevice varchar(100),
@v_error int,
@p_database varchar(100),
@p_dest1 varchar (1000)
set @p_dest1 = 'd:\dbbackup\NW\'
set @p_database = 'Northwind'
set @v_filename = @p_dest1 + '\Northwind' +
convert(varchar(20),getdate(), 112) + '_' + convert(varchar(20),
getdate(), 108)
+ '_full'
set @vbackupdevice = @v_filename
select @v_filename
select @vbackupdevice
if exists (select 'x' from master..sysdevices where name =
@vbackupdevice)
exec sp_dropdevice @vbackupdevice
EXEC @v_error = master..sp_addumpdevice 'disk', @vbackupdevice,
@v_filename
BACKUP DATABASE @p_database TO @vbackupdevice WITH INIT, NAME =
@p_database, NOSKIP , STATS = 10, DESCRIPTION = @v_filename, NOFORMAT
After I run this script I receive the following message:
'Disk' device added.
Server: Msg 3201, Level 16, State 1, Line 22
Cannot open backup device
'd:\dbbackup\NW\\Northwind20031203_17:05:11_full'. Device error or
device off-line. See the SQL Server error log for more details.
Server: Msg 3013, Level 16, State 1, Line 22
Consequently the backup fails. However, when I look at the
Backupdevices, there it is, exactly as printed in the errormessage. What
could be the cause of this? Should I end the CREATEDEVICE with a GO?
Which poses other problems, for this script is supposed to be part of a
SP.
Any comments welcome.
Tnx,
Hans Brouwer