• kravitej9 (1/29/2013)


    Can u send me the query

    This may help..

    DECLARE @temp AS TABLE

    (v1 INT, v2 INT, v3 INT)

    INSERT INTO @temp

    SELECT 1,3, NULL UNION ALL

    SELECT 3,4,5 UNION ALL

    SELECT 4,2, NULL UNION ALL

    SELECT 3,4, NULL UNION ALL

    SELECT 2, NULL, NULL

    SELECT DISTINCT

    cp.*

    FROM

    @temp

    CROSS APPLY (

    SELECT Newcol

    FROM (VALUES (v1), (v2), (v3)) X (Newcol)

    ) cp

    Andy

    ==========================================================================================================================
    A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe