Have a look at the demo code at SqlBulkCopyColumnMapping.DestinationColumn Property (System.Data.SqlClient) | Microsoft Docs
In particular note the comment against their example
Quote:Although the number of columns in the destination matches the number of columns in the source, the column names and ordinal positions do not match.
Only the columns for which you have created mappings will be copied over. In other words, your intent
Quote:I want to find a way to ignore the extra columns in the database and use its default value.
is achieved by using mappings. You may still run into issues if there is no default value for a target column that is not supplied and it is defined as NOT NULL.
As Gerry has said, your use of
is just confusing matters. It looks more like one of the columns in your ParquetReader doesn't exist on the target table (or may have a different type). You are blindly creating a mapping for everything on the reader
You should compare the schema of the ParquetReader to the target table and only add the mapping if the target column exists