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

MergeUI Does not exclude identity columns from update statements (Causes "Cannot update identity column 'X'") #23

Open
lestephane opened this issue Feb 7, 2018 · 0 comments

Comments

@lestephane
Copy link

When i use MergeUI to generate inserts + updates + deletes for a specific table of mine with an 'id' identity key, I get some statements that try to UPDATE identity columns, causing a Cannot update identity column 'id'.

Here is an example:

MERGE INTO [dbo].[...]
 AS TARGET
USING (VALUES(...) AS SOURCE(...) ON [SOURCE].[id] = [TARGET].[id]
WHEN NOT MATCHED ...
WHEN MATCHED AND (...) THEN UPDATE
SET [TARGET].[id] = [SOURCE].[id]

Why try to UPDATE [TARGET].[id] to the value of [SOURCE].[id] when the two where identical in the ON part of the MERGE statement?

@lestephane lestephane changed the title MergeUI Does not exclude identity columns from update statements (Causes MergeUI Does not exclude identity columns from update statements (Causes 'Cannot update identity column 'id') Feb 7, 2018
@lestephane lestephane changed the title MergeUI Does not exclude identity columns from update statements (Causes 'Cannot update identity column 'id') MergeUI Does not exclude identity columns from update statements (Causes "Cannot update identity column 'X'") Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant