Deleting rows referenced from another table.

I have a table with a ton of duplicate rows I need to remove.  I have it to the point where I have another table, with one field, ID, that contains the ID of the records I want to delete in the other table.

DELETE FROM bigtable WHERE ID = smalltable.ID

I know how I'd do this in something like C# but I'm stumped when it comes to SQL.  How do I run a loop through the smaller 'ID' table and at the same time, delete each of the associated records in the big table?  I probably need a join but how to incorporate the delete?

Thanks!
Meshman333Asked:
Who is Participating?
 
Chris LuttrellConnect With a Mentor Senior Database ArchitectCommented:
Delete from bigtable
FROM bigtable inner join smalltable on bigtable.ID = smalltable.ID
0
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
DELETE FROM bigtable WHERE ID IN (SELECT ID FROM  smalltable )
0
 
Meshman333Author Commented:
Awesome, thanks!
0
All Courses

From novice to tech pro — start learning today.