Reputation: 1
I'm using SqlBulkCopy
to insert records into a SQL Server database. I have a requirement to save the data into 3 tables based on the primary key which I get after inserting into 1st table. As the dataset inserts at a time without looping, I have no idea to get the primary key of the each inserted record.
Is there any possibility to get the primary keys of the rows inserted to use for the further insertions into different tables?
I'm converting the JSON input to DataSet and inserting that dataTable into SQL Server table by mapping the columns using SqlBulkCopy
.
Upvotes: 0
Views: 49