execute stored procedure with order by

  • daveriya (11/9/2011)


    thanks a lot DEV,that's what i was looking ,u solve my problem.

    I would love to accept Thanks but as Sean & Paul pointed out (in later posts) itโ€™s indeed a bad code. ๐Ÿ˜€

  • Dev @ +91 973 913 6683 (11/10/2011)


    daveriya (11/9/2011)


    thanks a lot DEV,that's what i was looking ,u solve my problem.

    I would love to accept Thanks but as Sean & Paul pointed out (in later posts) itโ€™s indeed a bad code. ๐Ÿ˜€

    Then why did you post it?

    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 (11/10/2011)


    Dev @ +91 973 913 6683 (11/10/2011)


    daveriya (11/9/2011)


    thanks a lot DEV,that's what i was looking ,u solve my problem.

    I would love to accept Thanks but as Sean & Paul pointed out (in later posts) itโ€™s indeed a bad code. ๐Ÿ˜€

    Then why did you post it?

    ... especially with all the warnings from others BEFORE Sean and Paul's final warnings?

    Your signature line says "I am looking for long term career opportunities in US... Can you HELP me please?" You might want to pay attention to code warnings of others in the future, Dev.

    --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)
    Intro to Tally Tables and Functions

  • Perhaps the reason for posting the answer Dev did was that 'daveriya' really wasn't getting the message, even after all our best efforts. The aliased UNION and ORDER BY ordinals did solve daveriya's problem, after all. It seemed daveriya was going to reject any solution that used column names, and aliasing the UNION might have been a necessary step to get daveriya to see how it was working...?

    It may be slightly disheartening, but we can only lead horses to water...

  • GilaMonster (11/10/2011)


    Dev @ +91 973 913 6683 (11/10/2011)


    daveriya (11/9/2011)


    thanks a lot DEV,that's what i was looking ,u solve my problem.

    I would love to accept Thanks but as Sean & Paul pointed out (in later posts) itโ€™s indeed a bad code. ๐Ÿ˜€

    Then why did you post it?

    Development Priorities:

    1.Dead Line

    2.If #1 is achievable, then readability / simplicity.

    3.If #2 is achievable, then best practices

    4.If #3 is achievable, then performance & maintainability.

    It looked like OP is comfortable with ordinal. So I provided him what he wanted. Thatโ€™s #2.

  • ... especially with all the warnings from others BEFORE Sean and Paul's final warnings?

    Your signature line says "I am looking for long term career opportunities in US... Can you HELP me please?" You might want to pay attention to code warnings of others in the future, Dev.

    I didn't get your linking on my signature & previous post.

  • Dev @ +91 973 913 6683 (11/10/2011)


    GilaMonster (11/10/2011)


    Dev @ +91 973 913 6683 (11/10/2011)


    daveriya (11/9/2011)


    thanks a lot DEV,that's what i was looking ,u solve my problem.

    I would love to accept Thanks but as Sean & Paul pointed out (in later posts) itโ€™s indeed a bad code. ๐Ÿ˜€

    Then why did you post it?

    Development Priorities:

    1.Dead Line

    2.If #1 is achievable, then readability / simplicity.

    3.If #2 is achievable, then best practices

    4.If #3 is achievable, then performance & maintainability.

    It looked like OP is comfortable with ordinal. So I provided him what he wanted. Thatโ€™s #2.

    Development Priorities:

    1.Dead Line

    1.Readability / simplicity.

    1.Best practices

    1.Performance & maintainability.

    All 4 are achievable without compromise. ๐Ÿ˜‰

    --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)
    Intro to Tally Tables and Functions

Viewing 7 posts - 31 through 36 (of 36 total)

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