Help with Parameters
Dsteyer
Posts: 3
Hi Everyone. First love the product so far. Was wondering if I could get some syntax help though with Parameters. Here is my old non SQLBackUp syntax:
Have been trying to figure out how to insert parameters using the new command but have not found any examples in help and I did not see anything here. Basically I pull from a table what databases I want backed up and fill the parameters with that information. Any help would be appreciated.
BACKUP DATABASE @iDataBaseName TO DISK = @iBackUpLocation WITH INIT , NOUNLOAD , NAME = @vBackUpName, NOSKIP , STATS = 10, NOFORMAT DECLARE @i INT
Have been trying to figure out how to insert parameters using the new command but have not found any examples in help and I did not see anything here. Basically I pull from a table what databases I want backed up and fill the parameters with that information. Any help would be appreciated.
Tagged:
Comments
The syntax for SQL Backup is very similar to native, the main difference being that since the command is contained entirely in a quoted string, you have to pad any singlr quotes by doubling up.
For example:
Some options are not supported, for instance STATS and NOUNLOAD. NOUNLOAD only applies to tape backup, which SQL Backup does not support, and stats can't be used. SQL Backup has an extended stored procedure called sqbstatus which can possibly fulfill that requirement.
Thanks for Replying. However using your code sample only gives me
Incorrect syntax near '+'.
I keep fiddling and chaning quotes but nothing is helping.
Here I stripped everything but the one variable:
One last additional comment
If I take the following:
highlight it and check syntax I get no errors.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
I am a new user of Sql Backup, andhave the same problem as the poster. I need to stuff a variable list of DB names into the backup command. You have not explained why this:
...does not work, even though it looks correct. and the solution below is more complex. any way to make it work?
Thanks,
Fred
but this does not, 'though it looks correct'.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8