Advertisement

06.17.2008 at 03:00PM PDT, ID: 23493422
[x]
Attachment Details

SQL Activity manager- I have a process that is running 2 transaction and is being blocked by another process at awaiting command

Asked by meteorelec in MS SQL Server, SQL Query Syntax

Tags: Microsoft, SQL, 2005

SQL Activity manager- I have a process that is running 2 transaction and is being blocked by another process at awaiting command, i have a trigger running and i beleive it may be whats causing the issue as i when i disabled the trigger and the issue has stopped. the problem is is that i cannot recreate  the blocking issue consistently,  how can i get to the bottom of this?

Attached is the trigger code.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
/****** Object:  Trigger [scheme].[mihaddcost_ins]    Script Date: 06/17/2008 22:25:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [scheme].[mihaddcost_ins]
 
ON [scheme].[opdetm]
 
AFTER INSERT
 
AS
 
--Trigger used to modify the driver field in opdetm with costs stored in stockm.
 
--The value entered depends on the currency of the customer.
 
--stockm.setup cost holds the sterling value
 
--stockm.shelf_life holds the euro value
 
 
 
    INSERT INTO [scheme].[opdetm_cost]
        
    SELECT i.order_no
          , i.order_line_no 
          , CASE WHEN RTRIM(LTRIM(c.currency)) = 'EUR' AND  s.shelf_life > 0
                              THEN s.shelf_life 
                              WHEN RTRIM(LTRIM(c.currency)) = 'EUR' AND  s.shelf_life = 0
                              THEN s.standard_cost
                              WHEN RTRIM(LTRIM(c.currency)) = '' AND s.setup_cost =0
                              THEN s.standard_cost
                              WHEN RTRIM(LTRIM(c.currency)) = '' AND s.setup_cost > 0
                              THEN s.setup_cost
                              ELSE 0
                          END
           * CASE WHEN i.order_line_status ='B'
							  THEN i.order_qty
							  WHEN i.allocated_qty>0
							  THEN i.allocated_qty
							  WHEN i.despatched_qty>0
							  THEN i.despatched_qty
							  ELSE i.order_qty
						  END
 
          , CASE RTRIM(LTRIM(c.currency)) 
                      WHEN 'EUR' THEN i.val/1.27
                      ELSE i.val END AS STGVAL
          , o.date_entered
          , i.line_type  
          , o.territory 
       FROM INSERTED i
       JOIN [scheme].[opheadm] o
         ON o.order_no = i.order_no
       JOIN [scheme].[slcustm] c
         ON c.customer = o.customer
       LEFT JOIN [scheme].[stockm] s
         ON s.[product] = i.product 
        AND s.[warehouse]= i.warehouse
 
Loading Advertisement...
 
[+][-]06.17.2008 at 06:46PM PDT, ID: 21809258

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.18.2008 at 01:43AM PDT, ID: 21811064

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.18.2008 at 06:00AM PDT, ID: 21812309

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.18.2008 at 06:08AM PDT, ID: 21812389

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.18.2008 at 06:50AM PDT, ID: 21812825

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Server, SQL Query Syntax
Tags: Microsoft, SQL, 2005
Sign Up Now!
Solution Provided By: floook
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628