Possible Duplicate:
How to update two tables in one statement in SQL Server 2005?
I have two tables and need to update one table and take effect to the other table.
These two tables are linked by a relationship
t1.col1 PK , t2.col1 FK
t1 t2
_____________ _____________
|col1| col2| |col1 |col2 |
|----|------| |-----|-----|
|1 | a | | 1 | d |
|2 | b | | 2 | e |
|3 | c | | 3 | f |
|____|______| |_____|_____|
How I can update these two tables in one query in SQL Server 2008 ?
I want to do something like that
Update College
Inner Join Class ON College.CollegeId = Class.CollegeId
set College.CollegeId = '33333333-3333-3333-3333-333333333333',
Class.CollegeId = '33333333-3333-3333-3333-333333333333'
where
College.CollegeId = '071887ea-3c93-40ce-a112-3b849d352064'
but I get an error:
incorrect syntax near the keyword "Inner"