INNER JOIN CHALLENGE

  • Mike01 (9/15/2010)


    For clarification, you should use the 3 part naming convention on all tables (when crossing databases like this), just so someone down the road will know where they are coming from.

    Ah... sorry, Mike. I have to disagree on that. If you use 3 part naming conventions in code and the name of the "remote" database ever changes, you end up having to go through all of your code and make a change. To wit... I try to never use the 3 part naming convention.

    Now... if you only use a 2 part naming convention, THEN you can make synonyms that point (via a 3 or 4 part naming convention) to the correct database. If that "remote" database ever changes (say, to another server or just to another name on the same server), all you have to do is change a handful of synonyms (1 for each table you access and, yes, can be easily scripted) and you're done. Easy peasy. 😉

    For those still using SQL Server 2000, you can accomplish the same thing by using "pass through" views which have both read and write capabilities.

    --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

  • Derrick Smith (9/15/2010)


    Ah crap, I did. Didn't even notice that. Hard to follow the logic of this query..working on it.

    BWAA-HAAA!!! You have to learn to roll the "R" in the word... it makes it sound so much more sophisticated. 😛

    --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 - 16 through 16 (of 16 total)

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