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

BulkUpdateAll on view with instead of trigger, throws error #36

Open
Arma-Branca opened this issue Sep 21, 2021 · 1 comment
Open

BulkUpdateAll on view with instead of trigger, throws error #36

Arma-Branca opened this issue Sep 21, 2021 · 1 comment

Comments

@Arma-Branca
Copy link

Arma-Branca commented Sep 21, 2021

Hi,
I'm currently using BulkUpdateAll to update view with an instead of trigger.
I'm aware that this is somehow a strange usage but there's no easy workaround.

Problem

The BulkUpdateAll will try to do UPDATE t0 SET {properties} FROM to JOIN {temp table}, but due to SQLServer limitations this is not permitted for Views with instead of triggers, and throws the following error:

UPDATE is not allowed because the statement updates view "" which participates in a join and has an INSTEAD OF UPDATE trigger.

Solution

One way to solve this problem would be using a MERGE statement instead of the JOIN and maybe even enable the insertion of new elements in case of the flag InsertIfNew is enabled.

Is this something that could be done, or are there advantages in the usage of the UPDATE statement in terms of performance?

@Arma-Branca Arma-Branca changed the title BulkUpdateAll on view with instead of trigger throws error BulkUpdateAll on view with instead of trigger, throws error Sep 21, 2021
@mtanneryd
Copy link
Owner

mtanneryd commented Sep 21, 2021 via email

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

2 participants