I'm getting an error while running a proc. through SSIS.. Error:
[Execute SQL Task] Error: Executing the query "Exec clk.id_Process ? ,? ,?" failed with the following error: "The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
I tried to trace out the problem by joining
"sys.dm_exec_sessions AS s
INNER JOIN sys.dm_exec_requests AS r ON r.session_id = s.session_id
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) AS st"
and found its getting strucked while updating a table
UPDATE ta
SET ta.id =
CASE
WHEN ta.id=tmp.MergeoldId THEN tmp.MergenewId
ELSE ta.id
END,
ta.Id2=
CASE
WHEN ta.Id2=tmp.MergeoldId THEN tmp.MergenewId
ELSE ta.Id2
END,
ta.Id3=
CASE
WHEN ta.Id3=tmp.MergeoldId THEN tmp.MergenewId
ELSE ta.Id3
END
--SELECT ta.id ,ta.Id2,ta.Id3, tmp.MergeoldId,*
FROM tel.TranAssemble ta WITH (ROWLOCK)
INNER JOIN clk.id_Process tmp WITH (NOLOCK) on (ta.id = tmp.MergeoldId OR ta.Id2=tmp.MergeoldId OR ta.Id3=tmp.MergeoldId )
WHERE tmp.Id >= @MinId AND tmp.Id < @MINID + @BatchSize
Any solution?