Editng or Stopping a Stored Procedure

  • Hi

    My work collegue has copied and created a Stored Procedure where it checks to see if this field in SAP gets left blank without any values if so the stored procedure kicks in, the problem with this is we are trying to do an Import on Sales Invoices and this Stored Procedure stops you from importing as it requires this filed to be inputted.

    Is there anyway I can make this Stored Procedure Inactive / Stop It from Running or basically editing it to take out the SQL code written for Sales Invoice, I have tried to edit it by selecting "Modify" on the stored procedure but when saving it just creates a SQL file but when going back into the stored procedure the code is still there.

    Any help will be appreciated.

    Regards

    Kurt

  • Sorry if I have not completely undestood your requirement but to modify the stored procedure you need to click on 'execute', not save! That way it will 'ALTER' the stored procedure.

    ---------------------------------------------------------------------------------

  • Just a suggestion, not being a sql server expert

    why not make a copy

    drop it until you are through

    create the procedure again after the load

    you can so the same thing if you just want to modify it

    Jim

  • I would not drop the procedure or 'blank' it out by modifying it. I would stop the process running the procedure. What initiates the procedure call?

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • I'm going to second John's suggestion. Figure out how the procedure is being executed and disable it while loading the data.

    If you can't disable the procedure call, could you put a dummy value in that column during the import? This is not ideal, but would solve the problem.

  • Hi

    Thanks to everyone who replied to my question, I have taken all answers into consideration. I went and did what NABHA has said by clicking on Execute instead of save, so I basically went in and highlighted the query that will effect the import and clicked on "Comment out the selected lines" then clicked on execute, this worked perfectly as now the import works without setting off the Stored Procedure for this function.

    Thanks once again to all that helped

    Regards

    Kurt

  • If you have to resort to this to prevent contention, I would recommend taking a serious look at the whole process that the stored procedure was introduced to do. If you have a stored procedure that is causing so much contention that you are unable to import rows, you've got bigger problems than you may think.

    Doing what you've done to get your imports working may help now, but you've essentially bandaged your system. You'll most likely have to revisit this again another day to get it fixed the right way.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply