Running sqlbackup dynamically

audunaudun Posts: 17
edited May 6, 2006 1:15PM in SQL Backup Previous Versions

I am trying out the software using sql2000 on win2003.

We have a customized backup script that is backing up our databases.
The following command fails:

exec sqlbackup '-SQL "BACKUP DATABASE ' +@dbname+' TO DISK = ''''' +@complete_filepath+''''' WITH NAME = '''''+ @BackupFile+''''', DESCRIPTION = '''''+ @Description+''''' , INIT"'END


Incorrect syntax near '+'.

printing the above command returns

-SQL "BACKUP DATABASE confirm_admin TO DISK = ''t:\backup\confirm_admin_full_20060506_080620.bak'' WITH NAME = ''confirm_admin_full_20060506_080620.bak'', DESCRIPTION = ''Full BACKUP at 20060506_080620.'' , INIT"

Running this commands directly in QA works fine.

Is this error to be expected?


Sign In or Register to comment.