Are you updating a view ? or an identity column ?
Main Topics
Browse All TopicsHello. I have a question about UPDATE with INNER JOIN.
UPDATE AliasA
SET AliasA.CarMaker = mstMakerModel.Maker
FROM tblCarAuctionList AS AliasA INNER JOIN
mstMakerModel ON AliasA.CarName = mstMakerModel.Model
It says that "CarMaker is not updateable". Can somebody give me the proper syntax?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Actually, I solved this on my own. Here's my solution:
UPDATE tblCarAuctionList
SET CarMaker = mstMakerModel.Maker
FROM tblCarAuctionList INNER JOIN
mstMakerModel ON tblCarAuctionList.CarName = mstMakerModel.Model
WHERE (tblCarAuctionList.Auction
(tblCarAuctionList.CarMake
tblCarAuctionList.CarMaker
AND (mstMakerModel.Maker IS NOT NULL);
Thanks for all your replies.
Regards,
Alan Wooley
you CAN use aliases in an update statement - just not on the SET items, which must be on their own with no tablename (as the set items have to be in the table referenced by the UPDATE clause)
(this was also the syntax originally posted by aneeshattingal...)
eg
UPDATE tblCarAuctionList
SET CarMaker = mstMakerModel.Maker
FROM tblCarAuctionList AliasA INNER JOIN
mstMakerModel AliasB ON AliasA.CarName = AliasB.Model
WHERE (AliasA.AuctionSite = 'USS') AND
(AliasA.CarMaker IS NULL OR
AliasA.CarMaker = '')
AND (mstMakerModel.Maker IS NOT NULL);
link to SQL Update Join
Business Accounts
Answer for Membership
by: aneeshattingalPosted on 2007-02-26 at 18:34:16ID: 18614331
try this, (r syntax looks fine for me
UPDATE AliasA
SET CarMaker = mstMakerModel.Maker
FROM tblCarAuctionList AS AliasA INNER JOIN
mstMakerModel ON AliasA.CarName = mstMakerModel.Model