Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2008
    Posts
    22

    Unanswered: Help with trigger

    Hello guys,
    I have a trigger that calls a SP. However the SP takes a while to execute. So the trigger is rejected.

    What is wrong

    Code:
    USE [sallymac] 
    GO 
    /****** Object:  Trigger [dbo].[BeginProcessing]    Script Date: 10/14/2008 10:23:37 ******/ 
    SET ANSI_NULLS ON 
    GO 
    SET QUOTED_IDENTIFIER ON 
    GO 
    ALTER TRIGGER [dbo].[BeginProcessing] 
       ON  [dbo].[Mytable] 
       AFTER  INSERT,update 
    AS 
    declare @id int,@username varchar(20) 
    select @id  = batchid, @username = username from inserted 
    
     -- SET NOCOUNT ON added to prevent extra result sets from 
     -- interfering with SELECT statements. 
     SET NOCOUNT ON; 
    
     --exec        Processing_BULK @id, @username 
     exec [dbo].[Processing_BULK ] @id, @username 

    PROBLEM:

    When I run the exec in red, it works ok. But when i run the execute SP in green, it hangs for a while and then rejects it.

    I have tried updating manually. Also ran the SP in Management studio, and has got a problem, only problem is that it takes a while to execute

  2. #2
    Join Date
    Apr 2007
    Posts
    183

  3. #3
    Join Date
    Oct 2008
    Posts
    22
    Not Answered

  4. #4
    Join Date
    Apr 2007
    Posts
    183
    Really?
    Remove the trailing space after processing_bulk stored procedure name just before the closing bracket...
    Last edited by Peso; 10-14-08 at 09:18.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •