How can we help you today? How can we help you today?

Back up multiple databases v4.6

I am having issues backing up all databases. Thoughts?

OS: W2k3 SP1

SQL Svr: 2k5

Syntax:

master..sqlbackup N'-SQL "BACKUP DATABASE [*] TO DISK = ''D:\BACKUPS\<AUTO>'' WITH NAME = ''<AUTO>'', INIT, ERASEFILES = 5, COMPRESSION = 2"'

Results:

Backing up * (full database) to:
D:\BACKUPS\FULL_(local)_*_20060823_000246.sqb

Error 880: BACKUP DATABASE permission denied in database: (*)
SQL error 911: Could not locate entry in sysdatabases for database '*'. No entry found with that name. Make sure that the name is entered correctly.

SQL Backup exit code: 880
SQL error code: 911

exitcode 880
sqlerrorcode 911
filename01 D:\BACKUPS\FULL_(local)_*_20060823_000246.sqb
chrisotte
0

Comments

2 comments

  • HJoyce
    It should be DATABASES not DATABASE to use * to mean all databases.

    e.g. master..sqlbackup N'-SQL "BACKUP DATABASES [*] TO DISK = ''D:\BACKUPS\<AUTO>'' WITH NAME = ''<AUTO>'', INIT, ERASEFILES = 5, COMPRESSION = 2"'
    HJoyce
    0
  • chrisotte
    Thanks!

    I knew it was a syntax issue...problem solved.
    chrisotte
    0

Add comment

Please sign in to leave a comment.