Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Set sql server connection Dynamically

(0) ShareShare
ReportReport
Posted on by 8

In the power automate flow, I need to establish multiple connection with the sql database Dynamically(on the Run time). Is there any way to establish connection in power automate flow on the run time?

  • olivierSOFILEC Profile Picture
    3 on at
    Re: Set sql server connection Dynamically

    Do you know a way to create a connection on a SQL server that can use the differents bases of this server?
    And, in a flow, change dynamicly the data base (not the serveur, juste data base).

  • Casper Profile Picture
    41 on at
    Re: Set sql server connection Dynamically

    Has anyone figured out a way around this?

  • HarshYadav Profile Picture
    8 on at
    Re: Set sql server connection Dynamically

    Yes, I don't want to write API using code.

  • HarshYadav Profile Picture
    8 on at
    Re: Set sql server connection Dynamically

    @eric-cheng, Multiple database on the single sql server.

  • eric-cheng Profile Picture
    5,171 on at
    Re: Set sql server connection Dynamically

    Hi @HarshYadav ,

     

    When you say multiple databases, I am assuming you mean multiple databases across multiple SQL servers right?

     

    I don't really know if there is a feasible option to achieve what you want to do that can remain both scalable and maintainable.

     

    Assuming you don't want to write any APIs using code, one approach which I haven't tested and honestly don't know if it will work would be to create linked servers and then use Power Automate to execute stored procedures against linked servers.  You would need to pass in parameters to act as the linked server name etc.  Again, no idea if it will work in the context of Power Automate.

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

     

  • HarshYadav Profile Picture
    8 on at
    Re: Set sql server connection Dynamically
    Hello Eric,
    Thanks for your reply.
    As we have a multi tenant environment and we have multiple database for respective customer. So we need to establish the connection to multiple database on the same power automate flow. But the case is, its not pre decided that when the power automate will run for which customer(Database). So the requirement is to create the database connection dynamically. Is there anyway to Achieve that?
  • eric-cheng Profile Picture
    5,171 on at
    Re: Set sql server connection Dynamically

    Hi @HarshYadav ,

     

    Can you elaborate what you are trying to achieve?  Do you need to connect to different SQL servers at runtime?

     

    You can create multiple connections and use that within the same flow.  Similarly, you should be able to use multiple SQL actions to connect to different SQL servers within the same flow.

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow