Skip to content

Commit

Permalink
Ensure identity insert Seed sync (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
devlead authored Jan 5, 2023
1 parent b6da606 commit 0cbac49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SqlBulkSyncFunction/Helpers/SqlCommandExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ ILogger logger
using var reader = sourceCmd.ExecuteReader();
using var bcp = new SqlBulkCopy(targetConn)
using var bcp = new SqlBulkCopy(targetConn, SqlBulkCopyOptions.KeepIdentity, null)
{
DestinationTableName = table.Name,
BatchSize = tableSchema.BatchSize,
Expand Down Expand Up @@ -279,12 +279,12 @@ ILogger logger

using var reader = sourceCmd.ExecuteReader();

using var bcp = new SqlBulkCopy(targetConn)
using var bcp = new SqlBulkCopy(targetConn, SqlBulkCopyOptions.KeepIdentity, null)
{
DestinationTableName = tableSchema.TargetTableName,
BatchSize = tableSchema.BatchSize,
NotifyAfter = tableSchema.BatchSize,
BulkCopyTimeout = 300
BulkCopyTimeout = 300,
};

foreach (var tableSchemaColumn in tableSchema.Columns)
Expand Down

0 comments on commit 0cbac49

Please sign in to comment.