Home Forums SQL Server 2012 SQL Server 2012 - T-SQL how to update column city value from 'A' to 'B' and 'B' to 'A' in single query RE: how to update column city value from 'A' to 'B' and 'B' to 'A' in single query

  • dastagiri16 (9/25/2013)


    hi,

    any single statement to complete this task

    Um...

    GilaMonster (9/25/2013)


    You can't do it in one statement, because updating a column to one value and then updating it to another require two statements. Though you could just have a single statement that does nothing and it'll have the same effect.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass