you are calling an INSERT
and trying to add duplicated keys. This error is by design, and essential. The DB is throwing an exception for an exceptional and erroneous condition.
If you are, instead, trying to perform an "upsert" you may need to use a stored procedure or use the MERGE syntax.
If, instead, you don't want to UPDATE
but to just ignore rows already in the table, then you need to simply add an exception to your INSERT
statement... such as
....
WHERE
table.Key <> interting.key