title: Violation of PRIMARY KEY constraint when INSERTing from a temp table
body: <p>I have a MS SQL (2012) table called [RlasRmSysUsers] and it has a super key of three different fields. I am trying to duplicate records, but save them back to the table with different IDs. I decided to create a temp table and fill it with the entries tied to a entered ID number. Then I change the ID number in the temp table, and finally I INSERT the temp table back into the original table. I can create, populate, and edit the temp table with no issues, but I get an error when I try to INSERT the temp table back into the main table. It says I violate the key and cancels the INSERT process. I check and the ID doesn't even exist in the original table yet. Ideas?</p>
  
  <p>I create the new temp table-</p>
  
  <pre><code>SELECT  [UserID]
    ,[UserRoleID]
    ,[UserFinBlockCd]
    ,[UserAOR]
    ,[UserOrgID]
    ,[UserName]
    ,[UserStatus]
    ,[UserActiveProfile]
    ,[LastChangeDt]
    ,[LastChangeBy]
    into #TempRLAS FROM [RlasRmSysUsers] WHERE UserID='12345.tmp' and UserActiveProfile = 1
  </code></pre>
  
  <p>I update the temp table</p>
  
  <pre><code>UPDATE #TempRLAS SET UserID='998877.POS', UserName = '', [LastChangeDt]= GETDATE(), [LastChangeBy]='990011.me';
  </code></pre>
  
  <p>Finally I try to add it to the original table and then drop it</p>
  
  <pre><code>INSERT INTO [RlasRmSysUsers] SELECT * FROM #TempRLAS; 
  DROP TABLE #TempRLAS;
  </code></pre>
  
  <p>table struct </p>
  
  <pre><code>CREATE TABLE [dbo].[RlasRmSysUsers](
  [UserID] [varchar](35) NOT NULL,
  [UserRoleID] [varchar](12) NOT NULL,
  [UserFinBlockCd] [char](4) NOT NULL,
  [UserAOR] [varchar](12) NOT NULL,
  [UserOrgID] [varchar](10) NULL,
  [UserName] [varchar](35) NOT NULL,
  [UserStatus] [char](1) NOT NULL,
  [UserActiveProfile] [char](1) NOT NULL,
  [LastChangeDt] [datetime] NOT NULL,
  [LastChangeBy] [varchar](35) NOT NULL,
  CONSTRAINT [PK_RlasRmSysUsers_UserID_UserRoleID_UserFinBlockCd] PRIMARY KEY NONCLUSTERED 
  (
  [UserID] ASC,
  [UserRoleID] ASC,
  [UserFinBlockCd] ASC
  )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  =     ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
  ) ON [PRIMARY]
  </code></pre>