I've previously used the SQL Server 2008 R2 "import data" wizard to import an Excel file into my database.

Now I'm trying to import more Excel sheets that may contain the same data that was previously imported.

How can I import these Excel sheets to the same database, while skipping the rows from Excel that already exist in the database?


2008 supports except. Import the excel data into a different table--mytemptable--then

INSERT INTO mymaintable
SELECT * from mytemptable
SELECT * from mymaintable;

Then you can get rid of mytemptable (or whatever you want to call it).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy