Name of input parameter of stored procedure?
DavidCook
Posts: 8 Bronze 2
Is the parameter passed into the SQLBackup stored procedure named? I'm attempting to use a product called "Automise" to do a bunch of things, including backup up a DB, and the available actions include running a stored procedure via ADO, but not by a script. The properties of the action require naming the parameter(s) of the stored procedure, and passing appropriate values to them. I can't seem to find in the documentation the name of the input parameter. Does it in fact have a name? (The documentation mentions -I, -U, -P and -SQL parameters, but doesn't name them)
As an example, if I have the following:
exec master..sqlbackup N'-SQL ""BACKUP DATABASE [H2LatrobeTest] TO DISK = [\\LHS-SQL01\SQLBackup\Test\H2LatrobeTest-20070624.sqb] WITH INIT, COMPRESSION = 1""'
I'm assuming everthing from the N to the =1""' inclusive is a text string passed into the stored procedure as a parameter, and that parameter will be named something such as CommandToRun.
Am I close to the mark here?
As an example, if I have the following:
exec master..sqlbackup N'-SQL ""BACKUP DATABASE [H2LatrobeTest] TO DISK = [\\LHS-SQL01\SQLBackup\Test\H2LatrobeTest-20070624.sqb] WITH INIT, COMPRESSION = 1""'
I'm assuming everthing from the N to the =1""' inclusive is a text string passed into the stored procedure as a parameter, and that parameter will be named something such as CommandToRun.
Am I close to the mark here?
Comments
Automise appears to use the sp_procedure_params_rowset function to retrieve the list of parameters. This information does not exist for extended stored procedures e.g. xp_sendmail. The 'Load procedures' option does not load extended stored procedures either, suggesting this action wasn't designed with extended stored procedures in mind.
I've tried using different actions to 'automise' SQL Backup, and the only one I got working satisfactorily was to use the 'Run script' function (Misc). The SQL Server actions all had one quirk or another, and could not return the exitcode/sql error codes correctly (or maybe it's just my inexperience with that app).
Here's a sample script I found workable:
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8