March 20, 2014 at 8:23 am
I'm attempting to create a new scheduled task to backup a SQL Sever 2008 R2 express database. I have an existing backup with the INIT option running against the database in question, and decided to modify to NOINIT. Rather than overwrite, I elected to create a new one. It will not run.
I'm getting return code 1 - last run result indicates (0x1). All other tasks (all backing up other databases) are running without issue. Googling has not yielded much.
Program/script set to"
"C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE"
Added arguments:
-S instance-name -i"D:\user-script\backup_noinit_script.sql"
backup_noinit_script contents:
BACKUP DATABASE [Resource] TO DISK = N'D:\SQL_Database_Backup\Resource_noinit.bak' WITH NOFORMAT, NOINIT, NAME = N'Resource-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO
Following the events, Task Scheduler launches instance of of task (script), the Task Engine receives a message from Task Scheduler to launch the task (script). Task Scheduler starts instance of script. Task Scheduler launches the SQLCMD.EXE in instance of the task (script). Task Scheduler launches the script. The next event indicates the Task Scheduler successfully completed the script / action SQLCMD.EXE with return code 1. Looks like standard event information - however I have no remedy.
This appears straight forward. Any ideas? Comments / URLs are appreciated - thanks.
March 21, 2014 at 9:54 am
March 24, 2014 at 6:38 am
Ran a query against the database using that script:
BACKUP DATABASE [Resource] TO DISK = N'D:\SQL_Database_Backup\Resource_noinit.bak'
It ran successfully, the bak was created. Any ideas?
March 24, 2014 at 7:28 am
Hi There,
Does the SQL Log give any more details?
If you now run the entire backup command from ssms does it complete?
Which user runs the Job and what permissions does it have?
March 24, 2014 at 8:14 am
I created a new task, creating everything from scratch again (script, task arguments, everything). Backup ran successfully. No rhyme or reason as to what happened. Hiccup in my thinking or system. Very frustrating.
Thank you for responding.
March 24, 2014 at 8:49 am
March 28, 2014 at 2:24 am
An error has occurred while setting up a connection to the server when connecting to SQL server 2005, this failure may be caused by the fact that under the default settings SQL server does not allow remote connection.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply