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 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,963 Moderator 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

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 801

#2
Valantis Profile Picture

Valantis 602

#3
Haque Profile Picture

Haque 581

Last 30 days Overall leaderboard