• Lynn Pettis (1/26/2009)


    Tom.Thomson (1/26/2009)


    J (11/6/2008)


    Sorry - you were wrong

    No. YOU ARE wrong.

    It does not matter if there are duplicates or not, because the question specifically mentioned that there were no duplicates.

    So "UNION ALL" is entirely satisfactory.

    And modifying the structure of tables is hardly a "workaround". There are consequences to doing this.

    Now, gimme my points! And double them for amends! Or else !

    I'm a hundred percent in agreement with this reply. Plus the varchar(max) option doesn't exists in SQL 2000, which is where most SQL Server databases still are.

    The answer is wrong, completely wrong!

    Tom

    Unfortunately, the question specifically stated SQL Server 2005, as shown in the following quote from the question:

    You have a default SQL2005 Standard.installation with 2 tables:

    So this comes down to reading the WHOLE question before answering.

    Mea maxima culpa! I should read more carefully, my addition about sql 2000 was totally irrelevant.

    BUT: union all is still entirely satisfactory, since there are known to be no duplicates (part of the probl;em, statement) - and union instead of union all will perform less well (since it has to do the unneeded check for duplicates). AND making modifications to table structure is NOT a good workaround, there are potentially many side effects. I'm not sure if it was you who originally made those comments or someone else, but that was what I was agreeing with.

    Tom

    Tom