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 Automate / Execute SQL Query Error
Power Automate
Unanswered

Execute SQL Query Error

(1) ShareShare
ReportReport
Posted on by 10
Getting error message in step Execute a Sql Query.
status": 400,
  "message": "Incorrect syntax near 'concat'.\r\nclientRequestId: 
How to fix the SQL statement or is there another approach to this to insert all rows at once in Sql server?
 
2. Compose
3. Initialize Variable
4. Compose 2
5. Compose 4
6 .Execute a SQL query
 
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 on at
    Hi
     
    You are not getting a SQL error, you are getting an error in the Concat action (which is what it says).
     
    Without even looking further you use substring and sub which are not the same, you need to fix that. Then see if your stuff works.
     
    Also, since its the Substring, it would really be helpful to paste the expression, not just a picture, because then we have to type it all out.
  • RPWC Profile Picture
    10 on at
    Sorry for not adding these.  
    I'm totally lost how to fix this concat issue.  Can you please guide me.
     
    Compose:
    INSERT INTO test(FirstName,LastName,BirthDate,Salary,Gender,Department,JobTitle) VALUES 
     
    Compose 2: 
    concat('(', '''', item()?['FirstName'], '''', ',', '''',item()?['LastName'], '''', ',', '''',item()?['BirthDate'], '''', ',', item()?['Salary'],',', '''',item()?['Gender'], '''', ',', '''',item()?['Department'], '''', ',', '''',item()?['JobTitle'], '''','),')
     
    Compose 4:
    concat(outputs('Compose'), substring(join(variables('ArrayVar'), ','), 0, sub(length(join(variables('ArrayVar'), ',')), 1)), ';')
     
    NOTE:  Salary is decimal(18,2).

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard