cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JasonYeung
Frequent Visitor

Deleting records from on prem database from Power Automate

Hi,

 

I'm currently creating a Flow in Power Automate that queries the Account entity in Dynamics CRM (Cloud) and inserts it to an on prem SQL database. I was able to get the flow to insert the records to the correct table, but I want the flow to delete all the records in the table beforehand. (in an SSIS package, a SQL query like "DELETE table" would be executed before importing).

 

I was wondering how do I do this with Power Automate?

 

Sincerely,

 

Jason

 

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User III
Super User III

Hi @JasonYeung 

I guess the reason why you're asking this question is because the 'Execute a SQL Query' action isn't supported with on premise databases.

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Support-quot-Execute-a-SQL-query-quot-actio...

The workaround is to create a SQL Stored procedure that deletes the data from your table. You can then call this stored procedure from your Flow.

View solution in original post

3 REPLIES 3
timl
Super User III
Super User III

Hi @JasonYeung 

I guess the reason why you're asking this question is because the 'Execute a SQL Query' action isn't supported with on premise databases.

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Support-quot-Execute-a-SQL-query-quot-actio...

The workaround is to create a SQL Stored procedure that deletes the data from your table. You can then call this stored procedure from your Flow.

View solution in original post

JasonYeung
Frequent Visitor

Hi @timl ,

 

Thanks for your help. The stored procedure worked.

 

Sincerely,

 

Jason

Hi,

 

I have created a SQL Stored procedure (on-premise) to delete the data from my table, however, the store procedure "sp_deleteTable" isn't shown within the "procedure name" dropdown (as is shown in the image attached).

 

Do you have any idea??1.png

 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,331)