title: Copying the same data in sql, from source table to target table using merge is read as different data but it is the same json source parsed in sql
body: <p>I have a JSON String that I parsed out to fit my requirement, no problem doing it and it comes as I want it and I load that to my source table then I use merge to load my target table. this JSON string hasn't been changed for my source table it parse and truncate and load to my source table every time I run the procedure, but the issue is my merge read it as a different data so it loads it to my target table instead it should be read as the same and should not be load to my target. why is this happening? my target and source don't have any PK or Identity. I am using SQL Server 2017.
  <strong>Update:-</strong> I was able to do what I want using Lookup Transformation in SSIS. 
  But why when I run the procedure my merge read it as a new data since the JSON string hasn't been changed. help me understand this, please. Thank you</p>
  
  <p>here is a JSon String extracted from facebook.</p>
  
  <blockquote>
    <p>[{"value":75,"end_time":"2019-08-06T03:00:00-04:00"},{"value":6,"end_time":"2019-08-07T03:00:00-04:00"},{"value":5,"end_time":"2019-08-08T03:00:00-04:00"},{"value":3,"end_time":"2019-08-09T03:00:00-04:00"},{"value":50,"end_time":"2019-08-10T03:00:00-04:00"}]</p>
  </blockquote>
  
  <p>I have parsed out to this.</p>
  
  <pre><code>value       EndTime
  75          2019-08-06
  6           2019-08-07
  5           2019-08-08
  3           2019-08-09
  50          2019-08-10
  </code></pre>
  
  <p>Now this is in my Source table </p>
  
  <p>every time I run my proc, it calls the same metric to API and gets the JSON string above. </p>
  
  <p>here my merge</p>
  
  <pre><code>MERGE targetTable T
      USING
          (
              SELECT   
                      VALUE
                      ,EndDate
  
              FROM SourceTable S
  
          ) s
          ON
          (                                       
                      S.EndDate   = T.EndDate     
          )
  
      WHEN MATCHED AND
          (                   
                          ISNULL(S.VALUE,'')  &lt;&gt; ISNULL(T.VALUE,'')                               
          )
      THEN UPDATE
          SET                             
                      T.VALUE                 = S.VALUE                                       
  
      WHEN NOT MATCHED
      THEN INSERT VALUES
          (                                                
                               S.VALUE                            
                              ,S.EndDate                  
  
          );
  </code></pre>