web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Updating a SQL Record ...
Power Apps
Unanswered

Updating a SQL Record w/ a Trigger

(0) ShareShare
ReportReport
Posted on by 763 Super User 2024 Season 1

I have many tables in SQL Server that contain UPDATE TRIGGERS. Most are extremely simplistic and are used to keep the Modified date column up to date.

 

Here is my update trigger:

CREATE TRIGGER [powrapps].[trg_UPD_Amenity]
ON [powrapps].[tbl_Amenity]

AFTER UPDATE
AS

BEGIN
 SET NOCOUNT ON;

 UPDATE	t
 SET		Modified = GETDATE()
 FROM	powrapps.tbl_Amenity t
 JOIN	inserted i
 ON	t.Id = i.Id

END;

 

I have come to find out that when trying to use Patch() or UpdateIf() with a table that has a trigger, is a problem.

Initially I was just getting the following:

sperry1625_0-1692639821972.png

After much searching and tracing the SQL calls, I found the true underlying error:

 

The target table 'powrapps.tbl_Amenity' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.

 

I am not using an OUTPUT clause anywhere. 

 

I have disabled my triggers but would prefer to find a solution that doesn't require that.

 

Any thoughts?

 

Thank you.

 

 

Categories:
I have the same question (0)
  • EddieE Profile Picture
    4,641 Moderator on at

    @sperry1625 

    Seems this is an old issue still not resolved (from 2017)

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/cannot-have-any-enabled-trigger-if-the-statement-contains-an/td-p/39582

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard