• Matt Miller (2/21/2008)


    Again - being tentative here. My understanding is that "out" is only to be used when the first argument is a view or table. Anything T-SQL there will result in an error (with direction set to 'OUT').

    given the proc you have below - the only valid value for the @direction parameter is 'queryout'. Which kind of begs the question - why is it a parameter at all?

    Or - did I miss the question entirely again?

    And Jeff - there's something missing to the "existing connection" explanation. I ran that from within QA, and it fails without the -S parameter. Maybe because I'm on a named instance on a machine with several instances (I'm ONLY on named instances - no default instance)?

    I use bcp so little, I'm very rusty. Well - I actually use it a LOT - my jobs run it bunches of times a day - but I haven't had to tweak them in so long - I forget~!

    I agree... always better to include the -S parameter, mostly for the reason you've stated.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)