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
 Transact-SQL (2000)
 Ambiguous Table

Author  Topic 

MBeal
Posting Yak Master

110 Posts

Posted - 2005-10-20 : 12:18:08
This seems so simple however for some reason I cant see the forest for the trees...

Update Rooms
Set RmBlkOrder = N.RmBlkOrder
from Rooms R Inner join Rooms N
on Left(R.RoomNo,4) = N.RoomNo
Where R.RmBlkOrder = 0 and
len(R.RoomNo) = 5

Running this query returns the following message:
Server: Msg 8154, Level 16, State 1, Line 1
The table 'Rooms' is ambiguous.

I have tried to add and remove alias' but I can't seem to get it to work. I'm sure it is an easy thing...

MBeal

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-10-20 : 12:53:44
You're mixing using table aliases and not using them. try this:

update r set
r.RmBlkOrder = n.RmBldOrder
from rooms r
join rooms n
on ...
where...


Be One with the Optimizer
TG
Go to Top of Page

MBeal
Posting Yak Master

110 Posts

Posted - 2005-10-20 : 15:32:51
Thank you very much, you guys are great!

MBeal
Go to Top of Page
   

- Advertisement -