Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Calling ssis job from trigger deadlock got happend.

$
0
0

Hi,

I am running my job for each insert / update on my application tables. I used below code to run my job. for first insert/update job is running when immediately coming for next inserts/updates(when multiple users entered and submitted the data from application) simultaneously which will locks the tables and dead lock got happens. so please suggest me the right way to approach this.

But my job should run immediately for each new inserts / updates.

Create trigger [Person].[updatetrigger]
ON [Person].[Address]
AFTER INSERT, UPDATE 
AS
WHILE EXISTS(SELECT 1 FROM msdb.dbo.sysjobs J JOIN msdb.dbo.sysjobactivity A ON A.job_id=J.job_id WHERE J.name=N'MYnew JOb'
 AND A.run_requested_date IS NOT NULL AND A.stop_execution_date IS NULL )
BEGIN
WAITFOR DELAY '00:00:01'
END
EXEC msdb..sp_start_job @job_name = 'MYnew JOb';


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>