• WhiteLotus (5/26/2015)


    Thanks for the link . NOTED πŸ™‚

    I attach the execution plan .

    Project text --> Table A

    Below query is clearer I think ( The query that I run ) :

    SELECT distinct PT."created_dttm" AS "Created_Datetime",

    PT."proj_task_id" AS "Project_Task_Id",

    CAST( "text" AS VARCHAR( 2000 ) ) AS "text"

    FROM "DB1"."dbo"."Table A" PT

    WHERE "code" = 'ABCD'

    I don’t think eliminate distinct will make any difference ….

    That's just a picture and tells us nothing. You need to right click on the actual execution plan, save it as a file, and attach that.

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