How can I query the execution status of a stored procedure or a SQL Server Agent job? I'm creating an Active Server Pages (ASP) page that executes a long stored procedure. If a user refreshes the page, the procedure starts and executes again. I want to include a query on the ASP page that determines whether the stored procedure is already running, and if so, prevents re-execution of the stored procedure.
...