Posted by pb648174 on 07/07/06 16:21
I frequently have the problem where I have a list of items to delete in
a temp table, such as
ProjectId Description
------------- ----------------
1 test1
2 test4
3 test3
4 test2
And I want to delete all those items from another table.. What is the
best way to do that? If I use two IN clauses it will do it where it
matches anything in both, not the exact combination of the two. I can't
do joins in a delete clause like an update, so how is this typically
handled?
The only way I can see so far to get around it is to concatenate the
columns like CAST(ProjectId as varchar) + '-' + Description and do an
IN clause on that which is pretty nasty.
Any better way?
Navigation:
[Reply to this message]
|