Newb - SQL Server IIF() Function

  • Jeff Moden wrote:

    Shifting gears a bit but on a similar subject... the PIVOT operator in MS Access is totally awesome.  I do NOT understand why MS made such a crippled version in SQL Server.

    If I recall correctly - it has been many years since I did anything in Access - the reason Access is better at this is because queries are generated at run-time.  Essentially they are dynamic SQL and will dynamically build the column list and the pivot operator(s) when the query is executed.

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Jeffrey Williams wrote:

    Jeff Moden wrote:

    Shifting gears a bit but on a similar subject... the PIVOT operator in MS Access is totally awesome.  I do NOT understand why MS made such a crippled version in SQL Server.

    If I recall correctly - it has been many years since I did anything in Access - the reason Access is better at this is because queries are generated at run-time.  Essentially they are dynamic SQL and will dynamically build the column list and the pivot operator(s) when the query is executed.

    Not what I meant, though... the PIVOT operator in Access has a whole lot more functionality built in and is a whole lot easier to use than the one in SQL Server.  It's like someone actually designed it to be useful. 😀

    --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 2 posts - 61 through 61 (of 61 total)

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