One option is to do something like:
DELETE FROM SQLTable
WHERE NOT EXISTS
(SELECT *
FROM
OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\YourExcel.xls', SheetName$)
AS Excel
WHERE Excel.IDColumn = SQLTable.IDColumn)
-Sue
On Wed, 5 Nov 2003 13:55:40 -0800, "AJ" <amrooney1 (AT) aol (DOT) com>
wrote:
Quote:
I have a SQL table where every record needs to be deleted
unless the record is listed in an EXCEL spreadsheet. I am
thinking that DTS is the way to go. I have used dts to
export and import data, but haven't tried anything like
this. Does anyone know if this is possible to do or how
to do it?
Thanks,
AJ |