Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete matching items

Status
Not open for further replies.

MrM121

Programmer
Aug 21, 2003
83
GB
Hi, I am trying to import excel worksheets from one excel workbook. What I need to do is import one of the workbooks into a separate table, then I need to use the ID field in that table to delete all records in another table that is already in the database with a matching ID field.

I can do the import/export procedures, I just don't have a clue about the checking part, as described above.

Thanks,

Nick
 
how about:

delete * from #database table name goes here#
where id in (select id from #excel table name goes here#)
 
just tried it now, excellent.

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top