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

Announcements

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard