Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Tech122
Frequent Visitor

Dynamic SQL Connection (ForEach Loop)

Hi Everyone,

I'm trying to loop through multiple databases, each with a different connection string. All the databases have the same structure and format. My goal is to parameterize the connection and query so that I can extract information from each database dynamically.

So far, my findings suggest that this is not yet supported in Fabric. Any updates on this would be greatly appreciated.

1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Hi Tech122,

We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.

If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.

Thank you.

View solution in original post

9 REPLIES 9
v-pnaroju-msft
Community Support
Community Support

Hi Tech122,

We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.

If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.

Thank you.

Thank you @v-pnaroju-msft , @NandanHegde and all. It appears that there is still a limitation in the Microsoft Fabric environment. 

v-pnaroju-msft
Community Support
Community Support

Hi Tech122,

Please find below some possible workarounds that may help resolve the issue:

  1. If feasible, consider migrating your data to Fabric-native components such as Lakehouse, Warehouse, or KQL databases. These components support dynamic content within pipelines and allow for the parameterization of certain aspects.
  2. If possible, consolidate data from multiple databases into a single data lake. This will enable you to query a centralised location, simplifying connection management and potentially enhancing performance.

If you find our response helpful, we request you to mark it as the accepted solution and provide kudos, as this will assist other community members facing similar queries.

Thank you.

Tech122
Frequent Visitor

Thank you for the responses. Is there any workaround or alternative approach to achieve the Dynamic SQL Connection handling in this scenario?  Any suggestions or best practices would be greatly appreciated. 

Tech122
Frequent Visitor

Thank you for the the responses. I was wondering if there is any workaround or alternative approach to achieve dynamic connection handling in this scenario. Any suggestions or best practices would be greatly appreciated.

Thank you again for your assistance

Tech122
Frequent Visitor

Thank you for all the responses.  I was wondering if there is any workaround or alternative approach to achieve dynamic connection handling in this scenario. Any suggestions or best practices would be greatly appreciated.

Thank you again for your assistance. 

v-pnaroju-msft
Community Support
Community Support

Thank you, @NandanHegde , for your response.

Hi @Tech122,

We sincerely appreciate your inquiry on the Microsoft Fabric Community Forum.

In addition to the response provided by @NandanHegde, each connection in Fabric is predefined, and dynamically modifying the connection string within a pipeline or dataflow is not possible.

We kindly request you to stay updated by referring to the following documentation:
What's New? - Microsoft Fabric | Microsoft Learn

If you find our response helpful, we request you to mark it as the accepted solution and provide kudos, as this will assist other community members facing similar queries.

Thank you.

Both :

1) Making the connection value dynamic (parameterzing the connectin values)

2) And dynamically updating the connectionid in the activity for non fabric objects

 

are not possible as of today.




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com
NandanHegde
Super User
Super User

Unfortunately, based on my understanding it is not possible to parameterzie connections for components other than fabric components.

So your guess is correct




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Helpful resources

Announcements
MarchFBCvideo - carousel

Fabric Monthly Update - March 2025

Check out the March 2025 Fabric update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.