Trouble with SQL Backup stored proc

Forum for users of Red Gate SQL Backup tool

Moderator: Chris Auckland

Trouble with SQL Backup stored proc

Postby kepr00 » Mon Jun 16, 2008 3:26 pm

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
kepr00
 
Posts: 25
Joined: Tue Nov 28, 2006 8:42 pm

Postby Brian Donahue » Mon Jun 16, 2008 4:29 pm

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]'
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby kepr00 » Mon Jun 16, 2008 5:07 pm

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
kepr00
 
Posts: 25
Joined: Tue Nov 28, 2006 8:42 pm

Wrong Password Entered

Postby sam88jeep » Wed Feb 17, 2010 7:41 pm

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...
sam88jeep
 
Posts: 12
Joined: Mon Jun 04, 2007 3:41 pm


Return to SQL Backup Previous Versions

Who is online

Users browsing this forum: No registered users and 1 guest