• SPs/Queries also behave bad when Spooling or work table comes in picture for heavy data temporary storage during intermediate stages. so to avoid this you can use temp table with index (if required ) to make the sql run faster.

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)