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.
| Author |
Topic |
|
Teroman
Posting Yak Master
115 Posts |
Posted - 2002-01-16 : 10:12:01
|
| Hi,ive got what i thought was quite a simple delete, looks a bit like thisdelete myTablefrom myTable T1join (select foo, bar from otherTable) D1on T1.foo = D1.fooleft outer join (select foo, bar from yetAnotherTable) D2on T1.foo = D2.foowhere D2.bar is NULLobviously the derrived tables and joins are more complex, but you get the idea.if i parse it, no problemsif i change the delete line for a select * then it parses and runs fineproblem is if i try to compile the proc as above, it complains that D1 and D2 are not in the query, specificallyServer: Msg 107, Level 16, State 2, Procedure wn_FuelPriceChange_Move_Valid, Line 48The column prefix 'D1' does not match with a table name or alias name used in the query.Server: Msg 107, Level 16, State 1, Procedure wn_FuelPriceChange_Move_Valid, Line 48The column prefix 'D2' does not match with a table name or alias name used in the query.whats going on, any ideas?its peeing me of quite a lot, i dont want to have to mess about with temp tablesthankscol |
|
|
Teroman
Posting Yak Master
115 Posts |
Posted - 2002-01-16 : 10:47:53
|
| problem solved, if anyone is interested you delete the alias, not the table, like this:delete T1from myTable T1join (select foo, bar from otherTable) D1on T1.foo = D1.fooleft outer join (select foo, bar from yetAnotherTable) D2on T1.foo = D2.foowhere D2.bar is NULLta da!!col |
 |
|
|
|
|
|
|
|