• cyberdaemon (5/14/2013)


    @ssCrazy

    You're right.. Do you any idea about this prob?

    I'll reiterate what Eugene is saying: you need to know how to collect the value you want from the stored procedure spQuery_GetSequenceNo. Is it from an output variable or from a result set? It shouldn't be from the return value because that's reserved for a specific purpose, and your test indicates that it isn't.

    I'd recommend that you run tests using SSMS rather than your client API. It shouldn't be too hard to figure it out. Using your client introduces a degree of obfuscation.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden