title: SQL Server using Except vs Binary_Checksum
body: <p>I am using SQL Server and want to do Bulk Updates but don't want any row to be re-updated if same values already exists.</p>
  <p>For Example Consider following tables with their data</p>
  <pre><code>DECLARE @UpdatedIds TABLE
  (
      BookId  INT
  )
  
  CREATE TABLE Book
  (
      [Id]        INT,
      [Name]      NVARCHAR(MAX)
  )
  
  INSERT INTO Book([Id], [Name])
  SELECT 1, 'Book1'
  UNION
  SELECT 2, 'Book2'
  UNION
  SELECT 3, 'Book3'
  UNION
  SELECT 4, 'Book4'
  UNION
  SELECT 5, 'Book5'
  
  CREATE TABLE #Book
  (
      [Id]        INT,
      [Name]      NVARCHAR(MAX)
  )
  
  INSERT INTO #Book([Id], [Name])
  SELECT 1, 'Book1_Changed'
  UNION
  SELECT 2, 'Book2_Changed'
  UNION
  SELECT 3, 'Book3'
  UNION
  SELECT 4, 'Book4'
  UNION
  SELECT 5, 'Book5'
  </code></pre>
  <p>What I want is when I run the following query</p>
  <pre><code>UPDATE [BO]
  SET [Name] = [BU].[Name]
  OUTPUT [INSERTED].[Id] INTO @UpdatedIds([BookId])
  FROM [Book] [BO]
  INNER JOIN #Book [BU] ON [BO].[Id] = [BU].[Id]
  
  SELECT * FROM @UpdatedIds
  </code></pre>
  <p>@UpdatedIds should have records of 1 and 2 not 3, 4, or 5</p>
  <p>I have 2 ways of doing this in my mind and would like to have opinions about which one will be fastest/better.</p>
  <ol>
  <li><p>Using <strong>Except</strong> Keyword and delete rows that already exists</p>
  </li>
  <li><p>Using <strong>Binary_Checksum</strong> that is comparing Checksums of records in actual table and in temp table and removing records with equal checksum</p>
  </li>
  </ol>
  <p>Thanks</p>