[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure

  • Hi All,

    I need to solve something asap and would appreciate your help. I am trying to call a stored procedure running on sql server 7 from my c++ appcode and I get the following error

    [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure dbo... sqlState=42000: nativeError=2812'

    Communication between my app code and stored procedures and work fine in the development and production environment. It is failing in the test environment. I need to get this fixed asap. Could it be the presence of(or absence of)some SQL patches or Microsoft patches could have caused this problem. ?

    Thanks

     

     

     

     

  • Check default database for the login.

  • Could you please be more specific ?

    More inputs from me are -

    1. app code is able to connect but I get that error when a stored procedure call is made.

    I compared the user perm for the user in my dev and test server databases and they were found to be same.

    I have a strong hunch that it has to do something with the permissions in the sql database but don't know how to prove it. The stored procedure runs in query analyzer after I log in using the same user .

    Thanks

  • Best practise is to always specify a specific database in your connectionstring !

    Rule No x : never rely on a @#|$! default ! 

    If that is correct , it must be an authority issue

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Also Fully qualify the procedure name. Make sure the owner of the procedure is the same in all environments.

  • Alzdba and sa24,

    The issue is fixed. I had pointed my dev appto test db and it didn't work whereas dev to dev worked. I had also tried fully qualified names. I got somebody to recycle sql cluster in the test environment nad it worked!!! All we had to do was recycle the cluster...ridiculous.

    Thanks for your suggestions.

    Best Regards

  • Do you have execute permission on this stored procedure?

  • Yes I had execute permission...I had matched them with the Development env...Now they work after the cluster recycle

  • simple fix exec [database name].[object owner].[stored procedure name]

    you must reference the database name in either the connection string or command text. Otherwise SQL will use the default database which may not be the intended one.

    Tung Dang
    Azure and SQL Server Solutions Provider
    DataZip

  • Please note: 10 year old post.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (6/17/2015)


    Please note: 10 year old post.

    Hopefully the OP isn't still looking for that procedure.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Alvin Ramard (6/17/2015)


    GilaMonster (6/17/2015)


    Please note: 10 year old post.

    Hopefully the OP isn't still looking for that procedure.

    Hopefully the SQL 7 server has long since been relegated to the trash heap.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (6/17/2015)


    Alvin Ramard (6/17/2015)


    GilaMonster (6/17/2015)


    Please note: 10 year old post.

    Hopefully the OP isn't still looking for that procedure.

    Hopefully the SQL 7 server has long since been relegated to the trash heap.

    One would think .... only deprecated our last one in 2014.

    ( and still have a bunch of SQL2000 and 2005 )

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 13 posts - 1 through 12 (of 12 total)

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