1

I created a simple package that imports from Excel into SQL Server. Is there a way to add a script to this package to look into the SQL table and make sure a value from the excel doesn't already exist before it adds the data? Basically, I have someone inputting data into Excel and i will run this job throughout the day to update a table I built. I just don't want dupes. Thanks!

3
  • I’d suggest putting the data from Excel into a separate table, then having a sp called from your package that loads into the main one with conditions to avoid duplicates. Commented Nov 6, 2017 at 21:40
  • Use Lookup component to filter duplicates. Commented Nov 7, 2017 at 5:57
  • Thanks TZHX, I think that's the route I am going with. Commented Nov 7, 2017 at 13:01

1 Answer 1

1

You can run your Data Flow Task through a Lookup component, setting your no matching entries handler ('General' tab) to 'Redirect rows to no match output', and then import only the 'no match output' into SQL Server.

You could also put a constraint on your SQL Server table to further secure it from dupes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.