I need to implement a tool that runs programs from SQL Server database when a DB record matches some condition. Is there a way to do it?
xp_cmdshell is a security problem, and also a design problem (making SQL Server run other apps is not really a happy circumstance, even if it can be forced to do so). And please, please don't take the trigger suggestion - that's the worst idea. What I would do first is modify, or create a wrapper for, the program you want to run, such that it polls the database for qualifying rows, and then works with them. If necessary make a table in the db to act as a queue for the rows to be processed, or a column to indicate rows where the process is complete.