Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

Where not exists best practice

I have an SSIS that gets our email blast unsubscribe list.

It numbers in the 10's of thousands of course.

I have a local table that the records are inserted into.

With these numbers of emails, what is the best practice and cleanest way to insert where not exists?
0
Larry Brister
Asked:
Larry Brister
  • 2
  • 2
2 Solutions
 
plusone3055Commented:
stackoverflow.com/questions/5288283/sql-server-insert-if-not-exists-best-practice
0
 
Larry Bristersr. DeveloperAuthor Commented:
That link gives several answers.

I'm looking for a best practice answer....not a link. Sorry.
0
 
plusone3055Commented:
no need to be sorry
when it comes to that there are several opinions. there is no end all know all heavenly "practice"

good luck :)
0
 
RimvisCommented:
Hi lrbrister,

Like plusone3055 said, I doubt there is some dedicated "best practice" source for stuff like that.

I would load incoming emails to the staging table, and then insert new records using LEFT JOIN, like in this example:

INSERT Competitors (cName)
SELECT DISTINCT Name
FROM CompResults cr LEFT JOIN Competitors c ON cr.Name = c.cName
WHERE c.Name IS NULL
0
 
Larry Bristersr. DeveloperAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now