Following are step(s):
1) Create a INSERT trigger on table
2) In the trigger definition, write the logic to stop the SQL Agent Job(s) based on Insertion if it is running.
USE msdb;
GO
IF EXISTS (
SELECT 1
FROM INSERTED
)
BEGIN
EXEC dbo.sp_stop_job N'YourJobName';
END
GO
No comments:
Post a Comment