Forum Discussion
randall
Contributor
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
9 years agoModerator
Are you setting the cursor inside the DeleteDatabase() function? The Run button only works with functions that have no parameters...
- randall9 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
Related Content
- 2 years ago
- 4 years ago
- 6 years ago
Recent Discussions
- 9 hours ago