Re: Violation of primary key



Zamdrist (zamdrist@xxxxxxxxx) writes:
As far as using NOT EXISTS vs. the Left Outer Join syntax...isn't this
more a matter of style than correctness? In a Left Outer Join the two
fields in the destination would be NULL as the source records are not
found in the destination table. I understand NOT EXISTS also works,
but I'm inclined to believe that using JOINs are more efficient.

It's indeed matter of style and expressiveness than correctness.

As for efficient, you can never tell before you benchmark the query at hand.
If the optimizer does it right, you should get the same plan in both cases
anyway.

--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: Evolution vs Abiogenesis
    ... matter of logistics. ... Origin -> Destination ... "Yoshiko Sasai at the RIKEN Center for Developmental Biology in Kobe, ... shows that both mouse and human embryonic stem cells can ...
    (talk.origins)
  • Re: Public disclosure of discovered vulnerabilities
    ... for that matter. ... using programming paradigms which permit proof of correctness. ... which anyone doing a mechanical analysis of the code can ... (or anyone compiling with a different compiler or on a ...
    (sci.crypt)
  • Re: why light speed is constant
    ... that matter, and this is what is all about, a definitely as a matter a fact. ... but light dont moves ... in which direction these crests ... source to destination -> v1 ...
    (sci.physics.relativity)
  • Re: Pepper Spray in Checked Bags
    ... Local laws on the subject of pepper spray don't matter as far as the ... The fact that it may be illegal at the origin and at the destination ... *Of course* the instant you pick up your bag at the ...
    (rec.travel.air)
  • Re: Why does everyone do it?
    ... off with a Cantor Critique? ... and on the correctness of those foundations relies the correctness of ... It doesn't matter. ... "Understanding Godel isn't about following his formal proof. ...
    (sci.math)