• Adi Cohn-120898 (7/9/2013)


    Jeff – Sorry for disappearing, but for some reason I missed your response. What I wanted to do was very simple. I was working on improving performance on a stored procedure. One of the changes that I've made was to make fewer data access statements. In the procedure there was a code that looked like that:

    Select @OldValue = Col1 from MyTable where PK=X

    Update MyTable SET Col1 = NewValue where PK=X

    I wanted to access the table only once instead of twice.

    Adi

    You are right to make such an improvement. The old code is not efficient.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP