Updating multiple columns sql server

Rated 3.89/5 based on 650 customer reviews

A requirement arises in many systems to update multiple SQL database rows.

For small numbers of rows requiring updates, it can be adequate to use an UPDATE statement for each row that requires an update.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions.

updating multiple columns sql server-69

updating multiple columns sql server-27

New Value Else employee Table.first Name End, lastname = CASE When(employee Table.lastname='N' and ID=20) THEN Value Table.

New Value Else employee Table.first Name End, lastname = CASE When(employee Table.lastname='N' and ID=20) THEN Value Table. UPDATE employee Table SET firstname = CASE When(ET.first Name='N' and ID=10) THEN VT.

New Value Else employee Table.lastname End, address = CASE When(employee Table.address ='N' and ID=30) THEN Value Table. New Value Else ET.first Name End, lastname = CASE When(ET.lastname='N' and ID=20) THEN VT.

New Value Else employee Table.address End FROM employee Table, Value Table where employee Table. New Value Else ET.lastname End, address = CASE When(ET.address ='N' and ID=30) THEN VT. But they don't try something quite as complex as this.

New Value Else ET.address End FROM employee Table ET, Value Table VT where ET.

Leave a Reply