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 / 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

I have the same question (0)
  • UshaJyothiKasibhotla Profile Picture
    203 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
    203 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
    Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 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

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard