To have the destination table assign the identity, DO NOT use the SqlBulkCopyOptions.KeepIdentity
option. Instead, don’t map the identity from the source, and don’t extract it from source to send through to SqlBulkCopy
.
More Related Contents:
- Any way to SQLBulkCopy “insert or update if exists”?
- C#: SQL Server Connection String
- Delete from two tables? [closed]
- Procedure or function xxxxx has too many arguments specified [duplicate]
- Using stored procedure output parameters in C#
- How can I set an SQL Server connection string?
- Insert entire DataTable into database at once instead of row by row?
- SQL Query slow in .NET application but instantaneous in SQL Server Management Studio
- Writing Recursive CTE using Entity Framework Fluent syntax or Inline syntax
- Passing List to SQL Stored Procedure
- Bulk Update in C#
- SqlParameter does not allows Table name – other options without sql injection attack?
- Get an IDataReader from a typed List
- EF 6 – How to correctly perform parallel queries
- What’s the fastest way to bulk insert a lot of data in SQL Server (C# client)
- How to keep single SQL Server connection instance open for multiple request in C#?
- Delete a single record from Entity Framework?
- sqlbulkcopy using sql CE
- How to use SqlCommand to CREATE DATABASE with parameterized db name?
- ExecuteNonQuery returning -1 when using sql COUNT despite the query string
- Failed to update .mdf database because the database is read-only (Windows application)
- What size do you use for varchar(MAX) in your parameter declaration?
- Sql Bulk Copy/Insert in C#
- Pros and Cons of using SqlCommand Prepare in C#?
- GO statements blowing up sql execution in .NET
- How to Identify the primary key duplication from a SQL Server 2008 error code?
- Provider named pipes provider error 40 could not open a connection to SQL Server error 2 [duplicate]
- Is it possible to use SqlGeography with Linq to Sql?
- Should the order of LINQ query clauses affect Entity Framework performance?
- How do I connect to a SQL database from C#?