What are the challenges you face when working across database platforms? Take the survey
Options

@Command cannot have more than 3200 characters.

WTSWTS Posts: 4
edited August 13, 2007 6:23AM in SQL Backup Previous Versions
Hi there:

Is there a way to work around this limitation in SQLBackup?
We have 200+ databases and while trying to create a TLog backup job I get the error that it could not write the command because: @command is too long. "It is to be no more than 3200 characters."

Thanks.

Comments

  • Options
    peteypetey Posts: 2,358 New member
    Is it possible to use the EXCLUDE keyword, or the wildcard '*' options instead of listing all the databases?

    EXCLUDE backs up all databases except the ones included in the list e.g.
    EXEC master..sqlbackup '-sql "BACKUP LOGS EXCLUDE [master, model, tempdb] ... " '
    
    The wildcard option will back up all databases running in full or bulk logged recovery models when used with the BACKUP LOGS command e.g.
    EXEC master..sqlbackup '-sql "BACKUP LOGS [*] ... " '
    
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Options
    The 3,200 character limitation is a restriction of the SQL Server Agent's job steps, rather than with SQL Backup directly (which in v5 can support up to 64,000 characters in a command).

    In addition to what Peter suggested, if you have generated the command using the GUI, you have the option to save the backup command as a "template". You can then use the following syntax to execute the backup command via the template:

    execute master..sqlbackup '-USE "<template_name>"';

    This may help get around the limitation...

    Hope that helps,
    Jason
Sign In or Register to comment.