locked
Could not find stored procedure RRS feed

  • Question

  •  

    keep getting this error

     

    Msg 2812, Level 16, State 62, Line 1

    Could not find stored procedure 'rpt_quarterly_DTP_Performance_test'.

     

    here is the code......the sp appears to be there

     

    any suggestions as to why i keep getting this error

     

    tx

     

     

    /*Drop stored procedure if exist in database*/

    IF EXISTS (SELECT name FROM sysobjects

    WHERE name = 'rpt_quarterly_DTP_Performance_test' AND type = 'P')

    DROP PROCEDURE rpt_quarterly_DTP_Performance_test

    GO

    CREATE PROCEDURE dbo.rpt_quarterly_DTP_Performance_test

    (

    @pClientSetID int = NULL ,

    @pClientID varchar(3) = '999' ,

    @pEmpGrpID varchar(255) = '999' ,

    @pFromDT datetime = NULL ,

    @pThruDT datetime = NULL ,

    @pPMPM decimal(9,2) = '0.33',

    @pJOBID varchar(8000) = NULL OUTPUT

    )

    Thursday, June 12, 2008 9:14 PM

Answers

  • The kind of error you are getting is coming from trying to execute the stored procedure and it not being there.  If you tried to drop it and it did not exist you would get a different error.  The code that you posted looks good other than defining the body of the procedure.

    Thursday, June 12, 2008 9:25 PM
  • As the previous poster stated the problem is mostly likely in the code that is trying to run this sproc.  Paste this code that executes the sproc here so we can help you.

     

    Things to do to verify the sproc exists in database:

    1) query the sys.procedures and check if sproc is in that table

    2) execute system proc sp_help, sp_procedures and check any message returned

    3) query the sys.objects and check if sproc is in there

    4) Verify that the sql login that executes the sproc has been granted right to do sox

    5) Log into mssql as a hi-level user like sa and try to execute the sproc

     

    Sincerely,
    John K
    Knowledgy Consulting
    http://knowledgy.org/

     
    Atlanta's Business Intelligence and Data Warehouse Experts
    Friday, June 13, 2008 3:04 AM
  • One more thing you might need to check is that 'u might be running the sp on a different database than in which u r creating it.'
    Friday, June 13, 2008 3:46 AM

All replies

  • The kind of error you are getting is coming from trying to execute the stored procedure and it not being there.  If you tried to drop it and it did not exist you would get a different error.  The code that you posted looks good other than defining the body of the procedure.

    Thursday, June 12, 2008 9:25 PM
  • As the previous poster stated the problem is mostly likely in the code that is trying to run this sproc.  Paste this code that executes the sproc here so we can help you.

     

    Things to do to verify the sproc exists in database:

    1) query the sys.procedures and check if sproc is in that table

    2) execute system proc sp_help, sp_procedures and check any message returned

    3) query the sys.objects and check if sproc is in there

    4) Verify that the sql login that executes the sproc has been granted right to do sox

    5) Log into mssql as a hi-level user like sa and try to execute the sproc

     

    Sincerely,
    John K
    Knowledgy Consulting
    http://knowledgy.org/

     
    Atlanta's Business Intelligence and Data Warehouse Experts
    Friday, June 13, 2008 3:04 AM
  • One more thing you might need to check is that 'u might be running the sp on a different database than in which u r creating it.'
    Friday, June 13, 2008 3:46 AM