February 29, 2008 at 10:30 am
Hi,Can I use SQL joint to update two tables or I have to write two separate queries
Why this query is not working?
UPDATE EquipmentRental SET EquipmentRental.DateReceived='2-29-08',
EquipmentRental.ReceivedBy=240,Inventory.StatusID=2 FROM Inventory
INNER JOIN
EquipmentRental on Inventory.ItemUniqueID=EquipmentRental.InventoryID
WHERE EquipmentRental.InventoryID=1012
February 29, 2008 at 10:52 am
Yoou can update only one table at a time. I imagine that kind of functionality that you'd like would create quite interesting effects regarding transactions.
Wrap two updates into one transaction or write a trigger on EquipmentRental to update Inventory.
Piotr
...and your only reply is slàinte mhath
February 29, 2008 at 10:53 am
Thanks for fast reply.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply