title: How to add New values into a table from a different table in SQL Server?
body: <p>I have recently migrated from Access backend to SQL Server. I have my front end in MS Access and backend in SQL Server. Now whenever a new client is created by the user, a stored procedure runs automatically which actually splits the data from the main table into different tables eg: The client table would have all the data and then it would be split into different tables like Address, Phone, etc. Now every time the stored procedure runs all the values from the client's table is inserted into other tables as all the value is duplicated. I just want the new values to be inserted into different tables and not the old values which are already present there.</p>
  <p>Stored procedure:</p>
  <pre><code>INSERT INTO [dbo].[ClientRelationstbl]
             ([CNR](FK)
             ,[RelationTypeID]
             ,[FirstName]
             ,[Surname]
             ,[LastUpdated]
             ,[UpdatedBy]
             ,[Active])
       SELECT
              [CNR](PK)
             ,1
             ,[FNM]
             ,[SNM]
             ,GETDATE()
             ,124
             ,1
      FROM [dbo].[clientstbl]
      WHERE [FNM] IS NOT NULL 
         OR [SNM] IS NOT NULL
         AND [CNR] NOT IN (SELECT DISTINCT [CNR] 
                           FROM [ClientRelationstbl])
  </code></pre>
  <p>[FNM] = FirstName Mother
  [SNM] = Surname Mother</p>
  <p>Now, whenever I try to run this it stores duplicate values in the table. I just want to store the new values in the ClientRelation table.</p>