Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Insert SQL commands in sql text stream #16176

Closed
dgxhubbard opened this issue Jun 20, 2019 · 1 comment
Closed

Feature Request: Insert SQL commands in sql text stream #16176

dgxhubbard opened this issue Jun 20, 2019 · 1 comment

Comments

@dgxhubbard
Copy link

We create a sample database, and in the creation we set our identity columns to specific values. On SQL Server to turn on Identity Insert we use

context.Database.ExecuteSqlCommand ( "SET IDENTITY_INSERT dbo.Tool ON;" );

we then call

context.SaveChanges ();

and then execute another sql command to turn Identity Insert off.

When we Add the entity, can you add a feature, to insert Identity Insert ON SQL command as text before the ADD and then to insert Identity Insert OFF SQL command as text after the Add.

SaveChanges generates the SQL text that will do the insert, so adding a way to insert SQL commands before and after the insert of each entity would allow us to move our SaveChanges from being done on each item to being done after entities were all added.

@smitpatel
Copy link
Member

Duplicate of #703

@smitpatel smitpatel marked this as a duplicate of #703 Jun 20, 2019
@divega divega closed this as completed Jun 20, 2019
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants