Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 alias in update statment

Author  Topic 

yakoo
Constraint Violating Yak Guru

312 Posts

Posted - 2001-11-06 : 16:47:12
I can't seem to use an alias in an update statement like so:


UPDATE Advertisers a SET a.AdvertiserName=atemp.AdvertiserName, a.AdvertiserDesc=atemp.AdvertiserDesc FROM #tempAdvertisers atemp WHERE a.AdvertiserID=atemp.AdvertiserID


if I try to do the following I get an 'Ambiguous column' error

UPDATE Advertisers SET AdvertiserName=atemp.AdvertiserName, AdvertiserDesc=atemp.AdvertiserDesc FROM #tempAdvertisers atemp WHERE AdvertiserID=atemp.AdvertiserID


any help would be much appreciated.


   

- Advertisement -