ycherkes / OrcaSql

A C# parser for MDF files. Allows you to read tables, metadata and indexes from MDF files without it being attached to a running SQL Server instance.
http://improve.dk/archive/2011/05/03/introducing-orcamdf.aspx
GNU General Public License v3.0
17 stars 7 forks source link

Cannot insert duplicate key #6

Open atrdev-rgb opened 1 year ago

atrdev-rgb commented 1 year ago

Violated "PK_CodesDictionaryTable" PRIMARY KEY constraint. Cannot insert duplicate key into object 'dbo.CodesDictionaryTable'. Duplicate key value: (1).

Is it possible to skip duplicate values ​​and create a table if it doesn't exist, and if it does, skip and go to filling?

ycherkes commented 1 year ago

I need more context. What are you doing to get this exception? I'm assuming that you're trying to export the data to the existing table. If so, I would strictly recommend you to create a temporary database and export the data to this DB instead.

atrdev-rgb commented 1 year ago

so that's the point. Skip the data that has already been added and add the missing ones

ycherkes commented 1 year ago

I'm not sure if there is any benefit. You can export the data to the temporary table without primary keys and other constraints, and after that all the power of SQL language will help you analyze and process it.