Hi,

I get an error when I run my T-SQL code where I have 25 databases. I'm wondering if there's a limit. Also the database names are really long, some are over 100 char names. I get the error code:
exitcode 5270
Error: SQB service is no longer running.

Below is my code:

DECLARE @exitcode int
DECLARE @sqlerrorcode int
EXECUTE master..sqlbackup N'-SQL "BACKUP LOG [TEST] TO DISK = ''\\Share\Tlogs\<AUTO>.sqb'' WITH COMPRESSION = 2, ERASEFILES_ATSTART = 2, INIT"', @exitcode OUT, @sqlerrorcode OUT
IF (@exitcode >= 500) OR (@sqlerrorcode <> 0)
BEGIN
RAISERROR ('SQL Backup failed with exit code: %d SQL error code: %d', 16, 1, @exitcode, @sqlerrorcode)
END
ASJ
0

Comments

3 comments

  • petey
    What version of SQL Backup are you running? What is the result when you run the following:
    DECLARE @version NVARCHAR&#40;32&#41;
    EXEC master..sqbutility 1030, @version OUTPUT
    SELECT @version
    
    Are you backing up the databases using individual commands e.g.
    EXEC master..sqlbackup '-sql "BACKUP DATABASE &#91;db1&#93; ...
    EXEC master..sqlbackup '-sql "BACKUP DATABASE &#91;db2&#93; ...
    EXEC master..sqlbackup '-sql "BACKUP DATABASE &#91;db3&#93; ...
    

    or all you backing up the databases by using the BACKUP DATABASES syntax e.g.
    EXEC master..sqlbackup '-sql "BACKUP DATABASE &#91;db1, db2, db3&#93; ...
    

    Thanks.
    petey
    0
  • ASJ
    Version is SQL Backup 5.4.0.55

    I am backing up using BACKUP DATABASES [db1, db2, db3, etc.]

    Thanks.
    ASJ
    0
  • petey
    Is it possible for you to back up the databases using the EXCLUDE option, so that you do not need to provide such a long list of database names e.g.
    BACKUP DATABASES EXCLUDE &#91;db1, db2&#93; TO DISK = ...
    
    If it's possible, could you please try it and check if it still causes the error?

    Thanks.
    petey
    0

Add comment

Please sign in to leave a comment.