Trouble with SQL Backup stored proc

kepr00kepr00 Posts: 43 Bronze 2
edited February 17, 2010 1:41PM in SQL Backup Previous Versions
Hello
I am having difficulty with the SQL Backup stored procedure.

This is the syntax I am using.
Use [master];
EXEC sqlbackup '-SQL "Restore Database MyDB From Disk=[D:\path\backup.sqb] With MOVE [MyDB_DATA] TO [D:\databases\MyDB_DATA.MDF], MOVE [MyDB_LOG] TO [D:\databases\MyDB_LOG.LDF], MOVE [MyDB_AUDIT] TO [D:\databases\MyDB_AUDIT.NDB], PASSWORD=[myPassw3d]"'

The error I get is Error 710: Wrong password entered.

When I copy this command an use the command line tool
SqlbackupC -SQL "Restore Database MyDB From Disk=[D:\path\backup.sqb] With MOVE [MyDB_DATA] TO [D:\databases\MyDB_DATA.MDF], MOVE [MyDB_LOG] TO [D:\databases\MyDB_LOG.LDF], MOVE [MyDB_AUDIT] TO [D:\databases\MyDB_AUDIT.NDB], PASSWORD=[myPassw3d]"

It works just fine.

Is there something incorrect with the procedure syntax?

I am running both the stored procedure command and the command line command on my local box.
I have verified that the paths listed in the command exist.
I am using windows authentication for my sql logon in both cases.
My windows user has admin priviledges on the local box.
My sql logon has restore priviledges and is in the sysadmin role.
I am using SQL Backup version 5.3.0.178.

Thanks in advance for your help.
Steve T

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Steve,

    Because the brackets are treated as identifiers by SQL Server, I'd imagine that passwords containing these would be handled differently by the command prompt interpreter as opposed to the SQL query parser. In the SQL query version, you may want to try padding out your password, for instance myPassw3rd or '[myPassw3rd]'
  • kepr00kepr00 Posts: 43 Bronze 2
    There are no brackets in the password.
    From the help file, this is a sample that I was working from
    master..sqlbackup '-SQL "BACKUP DATABASE pubs TO DISK = ''C:\Backups\pubs.sqb'' WITH PASSWORD = ''MyPassword'' " '

    Alternatively, you can use square brackets instead of two single quotes:

    master..sqlbackup '-SQL "BACKUP DATABASE pubs TO DISK = [C:\Backups\pubs.sqb] WITH PASSWORD = [MyPassword] " '

    I did, however, do some further troubleshooting.
    My actual password has an ascii 178(dec) or B2(hex) character in it which is a superscripted 2. This seems to be where the sqlbackup procedure is failing. When I create another backup without using this character, everything works in both the sql Command tool and the SqlBackup stored proc.

    So it seems that the SqlBackup stored procedure has some difficulty with ascii characters above 122(DEC) or 7A(HEX) where the command line SqlBackupC command has no such issues.

    It would be nice to see this limitation removed in a future release of SqlBackup.

    BTW, I also got an exception in this post when I tried to use the actual character in the body of this message.

    Thanks.
    Steve T
  • sam88jeepsam88jeep Posts: 14 Bronze 2
    I kept getting the 710 "Wrong Password Entered" error when using an older version of sqb2mtf.exe on a newer SQB file.

    Just thought I'd post this for anyone running into this...
Sign In or Register to comment.