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 / PAD Execute SQL statem...
Power Automate
Unanswered

PAD Execute SQL statement insert into

(0) ShareShare
ReportReport
Posted on by 19

all,

I am unable to successfully execute an "Execute SQL statement" to obtain an insert from an excel instance.

 

My connection works perfectly,

however my SQL statement bombs out on :

 

insert into Tbl_FN_invoices
select * from "%ExcelInstance%"

 

The table exists / error is 'invalid object name ExcelInstance'

 

any suggestions ?

  • AS-06081019-0 Profile Picture
    1,738 Super User 2024 Season 1 on at

    @kris_T I guess there could be 2 possible solutions:


    1.  SQL statement seems to be incorrect, it should be(without quotes)

          insert into Tbl_FN_invoices
          select * from %ExcelInstance%

    2. I believe read from excel worksheet action is missing. Therefore, I would recommend to use following actions:

    1. Launch excel
    2. Read from excel worksheet
    3. Execute SQL statement inside For each loop

    OR

          Do this(Considering excel file as database, efficient way to retrieve data):

    Ankesh_49_0-1655755575935.png

    Hope it helps!!


    Thanks
    Ankesh

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • VJR Profile Picture
    7,635 on at

    Hi @kris_T 

     

    - The right syntax is to do a select * from TableName.

    Since you are interacting with Excel, here TableName should be the Sheet Name whereas you have used the ExcelInstance.

     

    Take a look at line number 3 in @Ankesh_49's post.

     

    - The solution above is for using Excel as a Database.

    Not sure if you are looking for that or not.

     

    If you are looking to insert records from Excel into database then use the BULK Insert statement.

    https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Bulk-Insert-from-Excel-to-SQl/m-p/1621121

     

     

  • Riyaz_riz11 Profile Picture
    4,214 Super User 2026 Season 2 on at

    Hi @kris_T ,

    I think the syntax what you are provided wrong.

    select * from TableName.

    here table name refers Sheetname

    select * from [$Sheet1]

     

    Regards

    Ahammad Riyaz

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 231 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 170

Last 30 days Overall leaderboard