title: How to check before insert to table in sql in this example?
body: <p>i want to insert in the table after check exist or not exist in table.
  if exist no insert and if not exist insert.</p>
  
  <pre><code>INSERT INTO Database.[dbo].[TBL_AllProduct]
                     ([Product_Name]
                     ,[Product_URL])
  
  SELECT  
        t.v.value('(span[2]/a/text())[1]','nvarchar(max)') as [Name],
        t.v.value('(span[2]/a/@href)[1]','nvarchar(max)') as [URL]
   FROM @html.nodes('div/div') as t(v)
  </code></pre>
  
  <p>check <code>[name]</code> in <code>@html.nodes</code> if not exsit <code>value</code> of <code>[name]</code> in <code>column</code> <code>[product_name]</code> then insert into table. select from <code>@html.nodes</code></p>
  
  <p><code>t(v)</code> contain any rows , not only 1 row.</p>
  
  <p>exmaple for export <code>t(v)</code></p>
  
  <pre><code>--------------
      NAME
  --------------
      piter
      alex
      sony
      telephon
        .
        .
        .
  </code></pre>