Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Bulk Insert does not respect identity insert option #393

Copy link
Copy link
@jcwrequests

Description

@jcwrequests
Issue body actions

The best way to explain this is with code. The following works I can insert a value into an identity column

  using (var scope = new TransactionScope(TransactionScopeOption.Required, TimeSpan.FromSeconds(5 * 60)))
                        {
                            
                            foreach(var item in results)
                            {
                                Simple.Data.Database.
                                OpenConnection(destionationDBConnectionString).
                                WithOptions(new Simple.Data.Ado.AdoOptions(commandTimeout: (5 * 60), identityInsert: true))
                                [this.destinationTableName].Insert(item);
                            }
                            scope.Complete();
                        }

This does not. The table puts in the identity value:

     using (var scope = new TransactionScope(TransactionScopeOption.Required, TimeSpan.FromSeconds(5 * 60)))
                        

                            Simple.Data.Database.
                            OpenConnection(destionationDBConnectionString).
                            WithOptions(new Simple.Data.Ado.AdoOptions(commandTimeout: (5 * 60),identityInsert: true))
                            [this.destinationTableName].Insert(results);
                            scope.Complete();
                        }

I will try and examine the code and see if it can be fixed easily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.