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 / Power Automate Desktop...
Power Automate
Answered

Power Automate Desktop - Execute SQL Statement

(0) ShareShare
ReportReport
Posted on by 64

I am trying to Execute a SQL query in Power Automate Desktop. Part of my query includes the following code: 

 

And (Assign_To_Name = '%Smith%' Or
Assign_To_Name = '%Johnson%' Or 
Assign_To_Name = '%Null%')

 

However, I receive an error that states Invalid Column Name. I have tried severl different ways of executing code such as 

And( Assign_To_Name = "%%Smith%%") or Assign_To_Name like '%Smith%' but none of these syntax ways work. I think it is the modulus that is throwing it off. Any suggestions

  • UshaJyothiKasibhotla Profile Picture
    229 Moderator on at

    Hi @MCubedMama 

    Give coloumn name in square brackets.....

    For example [columnname]

    Then it works....please check.....

    Hope this helps,

    Usha.

  • MCubedMama Profile Picture
    64 on at

    @UshaJyothi20 So I tried that using And( [Assign_To_Name] = '%Smith%') 

    and I received the following error: Parameter 'SQL statement': Variable 'Smith' doesn't exist

     

  • UshaJyothiKasibhotla Profile Picture
    229 Moderator on at

    Hi @MCubedMama 

    Use this [columnname] = %variable%

     

    Hope this helps

    Usha

  • MCubedMama Profile Picture
    64 on at

    Thank you for helping. Unfortunately that doesn't work either

  • Verified answer
    CU16071609-1 Profile Picture
    6,255 Moderator on at

    @MCubedMama 

    Please follow the below syntax for variables:

    SELECT *  FROM TableName where  (Column_Name like  '%Variable1%' or Column_Name like  '%Variable2%')

    Deenuji_1-1709873115504.png

    If you want apply text instead of variable then use below syntax:

    SELECT * FROM TableName where ( Column_Name LIKE '%%Value%%' )

     

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 432

#2
11manish Profile Picture

11manish 313 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 154

Last 30 days Overall leaderboard