• Looks like homework, but if what you're after is the Names associated with columns A and B, perhaps a correlated sub-query would be best:

    CREATE TABLE #Table1

    (A CHAR(2), B CHAR(2), C VARCHAR(20), D VARCHAR(20), F VARCHAR(20));

    INSERT INTO #Table1

    SELECT 'A1','B1',NULL, NULL, NULL

    UNION ALL SELECT 'A2','B2',NULL, NULL, NULL

    UNION ALL SELECT 'A3','B3',NULL, NULL, NULL

    UNION ALL SELECT 'A4','B4',NULL, NULL, NULL

    UNION ALL SELECT 'A5','B5',NULL, NULL, NULL;

    CREATE TABLE #Table2

    (Loc CHAR(2), Name VARCHAR(20));

    INSERT INTO #Table2

    SELECT 'A1','White'

    UNION ALL SELECT 'A2','Black'

    UNION ALL SELECT 'A3','Red'

    UNION ALL SELECT 'A4','Orange'

    UNION ALL SELECT 'A5','Blue'

    UNION ALL SELECT 'B1','Green'

    UNION ALL SELECT 'B2','Yellow'

    UNION ALL SELECT 'B3','Gold'

    UNION ALL SELECT 'B4','Rose'

    UNION ALL SELECT 'B5','Silver';

    SELECT A, B

    ,NameOfA=(SELECT Name FROM #Table2 b WHERE a.A = b.Loc)

    ,NameOfB=(SELECT Name FROM #Table2 b WHERE a.B = b.Loc)

    FROM #Table1 a;

    GO

    DROP TABLE #Table1, #Table2;


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St