Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

Flow SQL Connection - Get Tables returns tables from a different database

(0) ShareShare
ReportReport
Posted on by 6

I have successfully set up a gateway and have working connections to 1 database in an on-premises SQL server express.

 

Today I created a 2nd database.  Flow allows me to create a connection through the gateway, but when I try to use the connection to Get Rows I get the following error:

 

{
"status": 400,
"message": "The key didn't match any rows in the table.\r\n inner exception: The key didn't match any rows in the table.\r\nclientRequestId: bb881838-baf1-44c5-98d8-c671fa327804",
"source": "sql-ne.azconn-ne.p.azurewebsites.net"
}

 

If I run Get Tables with this connection, it returns a list of tables from database 1 instead of database 2 that the connection was configured for.  When I run get rows, the connection returns a correct list of tables to choose from database 2, however it errors as above.

 

If i run Get Rows and hand enter a table name from database 1 (not from the pull down list) I am able to retrieve data from database 1.

 

So it appears that the connection for Database 2 is actually pointing to Database 1, even though on Get Rows the list of available tables is from Database 2.

 

I'm not sure if I need a different version (paid) version of flow to manage multiple connections to different databases or if I've configured the gateway improperly?  Any help would be appreciated. 

  • MARKLIGON Profile Picture
    MARKLIGON 6 on at
    Re: Flow SQL Connection - Get Tables returns tables from a different database

    It's not feasible to just delete all of the existing sql server connections because I have live applications that rely on them, unless you think it will actually work.  

  • v-zhos-msft Profile Picture
    v-zhos-msft on at
    Re: Flow SQL Connection - Get Tables returns tables from a different database

    Hi @MARKLIGON ,

    Sorry for that, I can't reproduce the  issue on my side.

    I suggest you delete the connections of SQL sever and rebuild the connections for a try.

    Capture5.PNG

    Best Regards,

    Community Support Team _ Zhongys

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

  • MARKLIGON Profile Picture
    MARKLIGON 6 on at
    Re: Flow SQL Connection - Get Tables returns tables from a different database

    I've done some more work on this.

     

    The problem is that even though I have selected the correct connection (booksConnection)  for my target database (eg. books), when the flow runs it is using an entirely different connection (toysConnection).

     

    I am using SQL server express. 

     

    When I monitor the books database with the flow trigger that does something when a new record is created in the books db, it accurately returns the values entered in the database..

     

    Anybody?

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard

Featured topics