• Cartesian products aren't things that help 😉 This is a cartesian product:

    SELECT <stuff> FROM LargeTable1 CROSS JOIN LargeTable2

    You get a huge resultset with a number of row equal to the product of the row counts in each table (hence cartesian product). It's a great way to kill a server.

    Is a table redesign not an option? It really, really would make stuff like this far easier.

    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