I recently had a need to run VBScripts from SQL. I figured rather than holding the scripts in an external file I’d prefer to have them hosted in the DB where they’re easier to maintain. In order to do this the best method I could come up with was to create functionality to push these scripts to a temp file, run the temp file, then delete it. I’ve included the script as a solution here, but would appreciate any feedback if you guys have other ideas also.
Share
This code allows users to run scripts which are hosted inside the database.
The scripts are run on the host server, under the server’s service account. Temp script files are put in the service account’s temp path (as defined by the environment variable %temp%).