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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Producing Dynamic SQL in Dataflow

As we can't currently pass parameters from Pipeline to Dataflow in Fabric, a workaround is to access Dynamic SQL from a txt file.

We can use Table.FirstValue to read the first row of a txt file

 

let
DynSQLTable = Csv.Document(Web.Contents("https://DOMAIN.sharepoint.com/Documents/DynSQLTest.txt"), [Delimiter = "|", Columns = 1, QuoteStyle = QuoteStyle.None]),
DynSQLString = Table.FirstValue(DynSQLTable),
Source = Oracle.Database("SERVER:PORT/SERVICENAME", [Query = DynSQLString , HierarchicalNavigation = true])
in
Source

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

I was just sharing a workaround for passing parameters into a Dynamic SQL query as we can't directly pass parameters to a Dataflow.

The snippet above was intended for anyone who wanted to do the same.

If you create a basic Gen2 Dataflow, and add a datasource....

then modify the code generated to read the Dynamic SQL from a file and parse it into the Query. 

View solution in original post

3 REPLIES 3
Steve_B77
New Member

@Anonymous Very useful - thanks

Anonymous
Not applicable

Hi @Anonymous ,

Thanks for using Fabric Community.

Are you sharing any information or asking any query.
With the above context I am not able to get a bigger picture of it.
Could you please share few more details of your scenario and about your issue?

Anonymous
Not applicable

Hi,

 

I was just sharing a workaround for passing parameters into a Dynamic SQL query as we can't directly pass parameters to a Dataflow.

The snippet above was intended for anyone who wanted to do the same.

If you create a basic Gen2 Dataflow, and add a datasource....

then modify the code generated to read the Dynamic SQL from a file and parse it into the Query. 

Helpful resources

Announcements
April Fabric Update Carousel

Fabric Monthly Update - April 2026

Check out the April 2026 Fabric update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.