I want to update two tables in one go. How do I do that in SQL Server 2005?
UPDATE
Table1,
Table2
SET
Table1.LastName=\'DR. XXXXXX\',
Table2.WApr
This works for MySQL and is really just an implicit transaction but it should go something like this:
UPDATE Table1 t1, Table2 t2 SET
t2.field = t2.field+2,
t1.field = t1.field+2
WHERE t1.id = t2.foreign_id and t2.id = '123414'
if you are doing updates to multi tables that require multi statements… which is likely possible if you update one, then another based on other conditions… you should use a transaction.