title: Violation of Primary Key Constraint - SQL Server
body: <p>In my SQL Server, I've created a database and I am trying to export the values from the 2 tables listed below into a new table that I created <code>DM_Location</code> within the database.</p>
  <p>But I keep getting this Error</p>
  <blockquote>
  <p>Violation of PRIMARY KEY constraint 'PK__DM_Locat__BA8F50140E575579'. Cannot insert duplicate key in object 'dbo.DM_Location'. The duplicate key value is (1).</p>
  </blockquote>
  <p>My code:</p>
  <pre><code>INSERT INTO DM_Location (Authority_Id, FacilityAddress, FacilityPostcode)
      SELECT AuthorityId, FacilityAddress, FacilityPostcode
      FROM dbo.2015_2016 
      UNION 
      SELECT DISTINCT AuthorityId, FacilityAddress, FacilityPostcode 
      FROM dbo.2016_2017
  </code></pre>
  <p>Any help would be appreciated! Thanks</p>