It seems to me that the speed difference is because in the first script, the UI waits for the query to execute before it moves to the next line and then completes the script. When you kick off a wscript.shell command, it executes the command to kick off the script and then immediately goes to the next line. It has no relationship or connection to the actual script that's running, so that script may or may not ever finish but the UI is immediately released. Depending on what your stored procedure is doing, that may or may not be a problem for you.
↧