SQL Server Performance

Urgent Help Neede Quickly !!

Discussion in 'SQL Server 2005 General DBA Questions' started by cqlguy, Dec 12, 2011.

  1. cqlguy New Member

    I have two tables:

    tableA
    COL1
    COL2
    COL3

    tableB
    COL1
    COL2
    COL3

    I want to write update query:
    I want to basically update tableB with condition from tableA

    so basically something like this i want: I want to update tableB set COL2=1 where tableA.COL2=3.

    How to write sql server query for that.
    Please help
    thanks
    sam
  2. cqlguy New Member

    will this update statement work ?
    update tableB set Col2=1 where tableA.COL2=3 ?
    Please advise?
  3. Madhivanan Moderator

    How are the tables related?

    Update B
    set col2=1
    from tableb as b inner join tableA as a on B.col1=a.col1

Share This Page