October 21, 2014 at 6:30 am
Hi,
i tried to use xp_cmdshell in order to execute a vbscript from a trigger and it works, but i notice that trigger wait until the vbscript was terminated.
i do some things into vbscript, so i can't wait until the end. There is a way to don't wait until the end, in practice, run vbscript in asynchronous mode???
thanks in advance
john
October 21, 2014 at 6:40 am
johnix76 (10/21/2014)
Hi,i tried to use xp_cmdshell in order to execute a vbscript from a trigger and it works, but i notice that trigger wait until the vbscript was terminated.
i do some things into vbscript, so i can't wait until the end. There is a way to don't wait until the end, in practice, run vbscript in asynchronous mode???
thanks in advance
john
Can you provide some background on this please – what is the underlying requirement?
October 21, 2014 at 6:52 am
thanks for response.
this is my need:
when a user insert or update a record (an orders table) i need to send an email in real time(from/to gmail) in order to advise company agents if some quantity are not processed.
can i do this in another way?
October 21, 2014 at 7:11 am
try to move the logic from vbscript to sql and use dbmail to send the email
Gerald Britton, Pluralsight courses
October 21, 2014 at 8:46 am
g.britton (10/21/2014)
try to move the logic from vbscript to sql and use dbmail to send the email
That's definitely a better approach. While I do like xp_cmdshell, it probably isn't the right tool for the job in this instance. The procedure will wait for the xp_cmdshell to finish, which means your table operation is held in limbo until it completes and continues on. Using sp_send_dbmail will queue the email and continue with the procedure. It will likely be much faster than waiting for a VBS to execute.
March 16, 2015 at 9:31 am
Hi ,
Can you send me the SQL script for calling a EXE from SQL server . I have tried to use xp_cmdshell from my stored procedure . But it is taking too long time to execute(more than 30 mins). Request you to send SQL and VB script.
Thanks in advance.
Senthil
March 16, 2015 at 9:43 am
senthil.k (3/16/2015)
Hi ,Can you send me the SQL script for calling a EXE from SQL server . I have tried to use xp_cmdshell from my stored procedure . But it is taking too long time to execute(more than 30 mins). Request you to send SQL and VB script.
Thanks in advance.
Senthil
create a SQL job, which uses a Operating System(CmdExec) step to run your executable.
then it's off line and asyncronous.
Lowell
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy