• Exactly my requirement is more or less same like what tfifield mentioned.

    And Jeff. i cant use AUTO INCREMENT for that column as it is requirement.

    So i go with following query

    declare ret_value bigint

    Update #tab2 set ret_value=UNQ_ID=UNQ_ID+1

    Thanks a lot Jeff and tfifield