Forum Discussion
Karthick_Balaje
1 year agoRegular Visitor
How to Ingest Stored procedures from Azure SQL DM to Fabric Onelake/Bronze lake House
Hi All! I have been stuck with this blocker while working on a task. I wanted to use a stored procedure and TimeValue Function from Azure SQL DB and build a KPI in Fabric. But I am stuck with this...
- 1 year ago
You can’t ingest stored procedure results directly into Fabric Lakehouse.
Workarounds:Best → Convert SP logic into a view and ingest via Dataflow Gen2/Pipeline.
Else → Make SP insert results into a staging table, then copy that table to Bronze Lakehouse.
Pipeline option → Use Stored Procedure activity (if enabled) to execute SP and land output in Lakehouse.
Transform in Fabric → Replicate SP logic (like TimeValue) in Dataflow Gen2 instead of DB.
- 1 year ago
1. Convert Stored Procedure Logic into a View
- Create a SQL view that replicates the logic of your stored procedure.
- Use Dataflow Gen2 or a Pipeline in Fabric to ingest the view into your Lakehouse.
- This is the cleanest and most scalable method.
2. Use a Staging Table
- Modify your stored procedure to insert results into a staging table.
- Then use a Copy Data activity in Fabric to move that table into your Bronze Lakehouse.
3. Use Script Activity in a Pipeline
- Fabric Pipelines support Script activities that can execute stored procedures.
- After execution, use a Copy activity to move the resulting table into the Lakehouse.
- Microsoft’s tutorial on preprocessing with stored procedures walks through this step-by-step.
4. Replicate Logic in Fabric
- If the stored procedure uses functions like TimeValue, consider replicating that logic in Dataflow Gen2 using Power Query M.
- This avoids dependency on SQL Server functions and keeps the transformation native to Fabric.
Next Steps
- Choose the method that best fits your architecture and governance model.
- Once the data lands in the Lakehouse, Power BI can connect directly to the default dataset or SQL endpoint for visualization.
anilgavhane
Super User
1 year ago1. Convert Stored Procedure Logic into a View
- Create a SQL view that replicates the logic of your stored procedure.
- Use Dataflow Gen2 or a Pipeline in Fabric to ingest the view into your Lakehouse.
- This is the cleanest and most scalable method.
2. Use a Staging Table
- Modify your stored procedure to insert results into a staging table.
- Then use a Copy Data activity in Fabric to move that table into your Bronze Lakehouse.
3. Use Script Activity in a Pipeline
- Fabric Pipelines support Script activities that can execute stored procedures.
- After execution, use a Copy activity to move the resulting table into the Lakehouse.
- Microsoft’s tutorial on preprocessing with stored procedures walks through this step-by-step.
4. Replicate Logic in Fabric
- If the stored procedure uses functions like TimeValue, consider replicating that logic in Dataflow Gen2 using Power Query M.
- This avoids dependency on SQL Server functions and keeps the transformation native to Fabric.
Next Steps
- Choose the method that best fits your architecture and governance model.
- Once the data lands in the Lakehouse, Power BI can connect directly to the default dataset or SQL endpoint for visualization.