Problem Backing Up Databases with Spaces in Name?

barnabybarnaby Posts: 4
edited November 29, 2005 11:44PM in SQL Backup Previous Versions
Hi Guys,

I need help working out what the script would be to backup a database which has spaces in the name via the extended stored proc syntax.

I have used the GUI (it works) and copied the script it generates into Query Analyzer but the script doesnt work????? I've tried no square brackets, lots of different quoting options and just cant seem to get it to work.....I do all our back ups using SQL jobs and need this to work.

The script is as below:
master..sqlbackup '-SQL "BACKUP DATABASE [MYOB TEST V370] TO DISK = ''D:\MSSQL$NAVISION\BACKUP\FULL_NAVISION_MYOB TEST V370_20051123 145639.sqb'' WITH NAME = ''Database (MYOB TEST V370), 11/23/2005 2:56:36 PM'', DESCRIPTION = ''Backup on 11/23/2005 2:56:36 PM Database: MYOB TEST V370 Instance: NAVISION Server: SQLMEL01'', COMPRESSION = 1" -E -I NAVISION'

The Error message I get is:
Output from SQL Backup (3.2.0)
SQL Backup 3.2.0, (c) Red Gate Software Ltd 2004 - 2005
Serial number: XXXXXXXXXXXXXXXXX
Syntax error: [ after DATABASE


Anybody got any ideas? had this problem?

Thanks,

Barney :-)

Comments

Sign In or Register to comment.