Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating 2 tables at the same time

Status
Not open for further replies.
Jun 17, 2004
73
US
Not sure if this is possible, I need to update 3 columns. My current query is below.
Code:
UPDATE TableA
SET		ColumnA=Value
		ColumnB=Value 
FROM	TableA A
INNER JOIN TableB B  ON A.tableid = B.tableid
  
WHERE	A.column = 'something' AND 
		b.column = 6

Column A and B are in Table A the third column is going to be in table B.

How do I adjust my query to add it.

/cry
/help

[viking2]
LVL 53 Paladin
 
You cant do it. UPDATE is for updating a single table.
If you require to update two tables and have them as an atomic unit, you need to do this within a transaction.



"I'm living so far beyond my income that we may almost be said to be living apart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top