June 17, 2008 at 2:16 pm
I need a SQL statement that will delete the rows in one table if that value exists in another table.
The first table has a list of file paths that I want to delete if those file paths exist in table 2.
Help is much appreciated.
June 17, 2008 at 2:17 pm
You can do that a couple of ways.
delete from dbo.Table1
where Path in
(select Path
from dbo.Table2)
delete from dbo.Table1
from dbo.Table1
inner join dbo.Table2
on Table1.Path = Table2.Path
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
June 18, 2008 at 9:22 am
Thanks a bunch.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy