Solved
Forum Discussion
randall
10 years agoContributor
function DeleteDatabase(srvrInstanceName, scriptPath) {
var commandDraft = "sqlcmd -S " + srvrInstanceName + " -i " + scriptPath;
var command = """ + commandDraft + """;
Log.Message("scriptPath = " + scriptPath);
Log.Message("command = " + command);
var Return = shell.Run(command, 1, true);
Log.Message("Return = " + Return);
if (Return != 0) { Log.Error("database deletion failed") }
}joseph_michaud
Staff
10 years agoAre you setting the cursor inside the DeleteDatabase() function? The Run button only works with functions that have no parameters...
- randall10 years agoContributor
Joseph,
I am and I believe I have found the error in my ways. When running a function with parameters I usually comment out the function start line and create a new one without any parameters. Then I explicitly define the parameters inside the function. I obviously forgot to do that this time.
Thanks for helping me to see the forest amongst the trees. :-)
Cheers,
Randall