BCP can't find a stored procedure

  • I created a simple stored procedure and when i try to call it though BCP i keep getting:

    Error = [Microsoft][SQL Native Client][SQL Server]Could not find stored procedure 'database.dbo.TestProc'.

    This is crazy.. the proc is there I just created it and verfied spellings etc. Why can't BCP find it???

  • what does your bcp statement look like?

    complete command must be on one line.


    N 56°04'39.16"
    E 12°55'05.25"

  • bcp "exec db1.dbo.[usp_testproc] 'test'" queryout "Y:\files\test.csv" -c -t, -T

    all on 1 line...

  • Where is the -S option? You have to tell BCP which server to use.

    There may actually be more than one instance on same server.


    N 56°04'39.16"
    E 12°55'05.25"

  • 3 Stupid questions.. Sorry I have to ask (bad experiences when I didn't)..

    1. Is the sproc actually owned by dbo, did you specify that when compiled..

    2. Is the sproc actually in that database, are you sure you compiled it in the right db..

    3. Does the user have rights to that DB and sproc, I know it didn't come back with a permissions error, but...

    CEWII

  • Elliott W (7/10/2009)


    3 Stupid questions.. Sorry I have to ask (bad experiences when I didn't)..

    1. Is the sproc actually owned by dbo, did you specify that when compiled..

    2. Is the sproc actually in that database, are you sure you compiled it in the right db..

    3. Does the user have rights to that DB and sproc, I know it didn't come back with a permissions error, but...

    CEWII

    1) Yes

    2) Yes

    3) AFAIK.

    🙁

  • Any reason you ignored my question about the -S option?

    Where you set the database server and/or instance to use.


    N 56°04'39.16"
    E 12°55'05.25"

  • The server switch did it.

    This guy has 3 instances of SQL Server 2k5 on him.

  • Apparently it didn't exist on the default instance..

    CEWII

  • You're welcome.


    N 56°04'39.16"
    E 12°55'05.25"

  • Thank you, Peso.

    I did not ignore your suggestion as you can see.

Viewing 11 posts - 1 through 10 (of 10 total)

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