Step 1: Log backup with copy (Error 50000)
I'm using a vbscript that generate a SQL Agent for LogShipping using SQL Backup. The agent created is : SQL Backup log shipping <database>
There's only one step into the agent.
Here's the T-SQL code :
DECLARE @success int
DECLARE @datestamp varchar(30)
DECLARE @backupcmd varchar(512)
SET @datestamp = left(replace(replace(replace(convert(varchar(30), getdate(), 120), '-', ''), ' ', ''), ':', ''), 12)
SET @backupcmd = '-SQL "BACKUP LOG [mydatabase] TO DISK=''<AUTO>'''+
' WITH COMPRESSION=1, NAME=''Database mydatabase, (log) '+@datestamp +
''', DESCRIPTION=''Database mydatabase, (log) '+@datestamp+''', COPYTO=''\\networkserver\SQL\Log'', ERASEFILES=1" -I myinstance'
EXEC @success=master..sqlbackup @backupcmd
RAISERROR('Backup failed for database mydatabase', 16,1)
When I look in the agent history of SQL 2005, all entry for that agent are in error with SQL Severity 16 and SQL Message ID 50000.
But the process did occur. Backup of log was done, copy to network folder and the 2nd server did restore the log.
Since I'm using monitoring tools on the Agents, it keeps poping up with that Agent error code. What is the cause of that error message and how can I fix it ?
Thanks in advance.