Launch a console application from SQL Server after asynchronously starting a table update?

I am having trouble finding the best way to solve my problem, please keep in mind that I am open to improving ways to solve this problem.

What I need to do, after updating the row value in my table, I need to use 2 fields from this table as parameters for the console application. Right now I can do this by setting a trigger in the table and then using xp_cmdshellto launch the application with the parameters. However, I need to do this asynchronously so that my stored procedure does not hang while it waits for the console application to complete.

Maybe I'm going to do it wrong.

I am using SQL Server 2008

EDIT. The answer from Andriy M seems to be the best at the moment, but as stated in the comments, I need a way to do this β€œinstantly”. Is it possible to call a task from SP or a trigger? or perhaps another way to achieve a similar result?

Thanks for helping everyone.

EDIT - I choose it below because it helped me best to come up with a better solution. What I'm doing is creating a task that simply queries my table against another that keeps track of updated rows. then when I have the lines that I need to update, I use xp_cmdshell to run my application with the specified parameters. so far this solution has been working smoothly.

+5
source share
4 answers

. , . , , , . , , , , .

, , SQL, , . -, , , , .

+5

Service Broker . , . .

+1

, (DLL) xp_cmd_shell.

0

CLR, . xp_cmdshell.

, xp_cmdshell. START. . xp_cmdshell .

0

All Articles