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

Error 5270

ASJASJ Posts: 3
edited June 27, 2011 8:33PM in SQL Backup Previous Versions
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
Thanks!

Comments

  • Options
    peteypetey Posts: 2,358 New member
    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.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Options
    Version is SQL Backup 5.4.0.55

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

    Thanks.
    Thanks!
  • Options
    peteypetey Posts: 2,358 New member
    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.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
Sign In or Register to comment.