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)
 Syntax error maybe?

Author  Topic 

M.E.
Aged Yak Warrior

539 Posts

Posted - 2002-08-13 : 14:47:15
Running this and getting the error underneath. I think it's my syntax, so the table ddl shouldn't be needed. I got no clue why that error is coming up.



delete Strat_pick_TXT
from Strat_pick_TXT txt
inner join resource_data_profile rdp on
case
when txt.Resource_Data_type ='1' then 'Calculated Vertical'
when txt.Resource_Data_type ='2' then 'Measured Vertical'
end
= rdp.depth_basis and
txt.resource_entity_id = rdp.resource_entity_ID and
'strat_pick' = rpd.resource_data_type
inner join #dupes d
on d.resource_entity_ID = txt.resource_entity_ID and
d.resource_data_seq = rdp.resource_data_seq and
d.pick_depth=txt.pick_depth
where txt.NewPK not in (select PKtoKeep from #dupes)

Server: Msg 107, Level 16, State 2, Line 1
The column prefix 'rpd' does not match with a table name or alias name used in the query.



-----------------------
Take my advice, I dare ya

Edited by - M.E. on 08/13/2002 14:50:13

Edited by - M.E. on 08/13/2002 14:56:07

izaltsman
A custom title

1139 Posts

Posted - 2002-08-13 : 15:21:21
Try


delete txt
from Strat_pick_TXT txt
inner join resource_data_profile rdp on
case
when txt.Resource_Data_type ='1' then 'Calculated Vertical'
when txt.Resource_Data_type ='2' then 'Measured Vertical'
end
= rdp.depth_basis and
txt.resource_entity_id = rdp.resource_entity_ID and
'strat_pick' = rpd rdp.resource_data_type
inner join #dupes d
on d.resource_entity_ID = txt.resource_entity_ID and
d.resource_data_seq = rdp.resource_data_seq and
d.pick_depth=txt.pick_depth
where txt.NewPK not in (select PKtoKeep from #dupes)




Edited by - izaltsman on 08/13/2002 15:22:06
Go to Top of Page
   

- Advertisement -