Forum Discussion
Load custom SQL function from Azure Synapse into Microsoft Fabric Lakehouse
- 1 year ago
Hi mtomova
- After creating stored procedure in Azure Synapse that includes your custom SQL function, create a pipeline Script activity to run the stored procedure in Fabric environment.
- Then in the pipeline use copy asiatnat activity to load preprocessed table data into Lakehouse. Now, execute the two pipeline activities to load the data in to your Lakehouse.
Please go through this official documentaion Preprocess data with a stored procedure before loading into Lakehouse - Microsoft Fabric | Microsoft Learn it might helps you to solve your problem.
Thank you!
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
Hi mtomova,
Thanks for reaching out to the Microsoft fabric community forum.
It looks like you want to migrate a custom T-SQL function from Azure Synapse Analytics to Microsoft Fabric's Lakehouse using Dataflow Gen2. This issue arises because Microsoft Fabric does not support directly storing or executing user-defined functions (UDFs) created in T-SQL within a Lakehouse. Unlike Synapse, where you can define and use SQL functions, Fabric’s Lakehouse architecture is based on Delta Lake, which does not natively support T-SQL functions like a traditional SQL database.
As suparnababu8 already responded to your query, please go through his response and mark it as solution if it answers your query.
I would also take a moment to thank suparnababu8, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real differenc
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Best Regards,
Hammad.
Community Support Team
If this post helps then please mark it as a solution, so that other members find it more quickly.
Thank you.
Dado que Dataflow Gen2 usa Power Query en lugar de SQL se debe reescribir la función en este lenguaje. 1.-Si la función realiza cálculos en columnas, se implementa la lógica con columnas calculadas en Power Query. 2.- Si la función es más compleja, por ejemplo transformaciones condicionales o agregaciones , usar funciones personalizadas en el lenguaje de Power Query. Estas son funciones definidas por el usuario para reutilizar lógica y aplicar transformaciones dinámicamente en Dataflow Gen2 o Power BI . Se puede usar para cálculos, limpieza de datos o transformaciones avanzadas. 3.-Si la función usa expresiones escalares o de tabla, se puede usar columnas calculadas, consultas referenciadas o transformaciones en Dataflow Gen2 . 4.- Si la función T-SQL es muy compleja, por ejemplo procesamiento en varias tablas o cálculos avanzados, se puede usar Notebooks en Fabric con PySpark o Spark SQL para replicarla. 5.- Si la función depende de SQL avanzado y no se puede convertir fácilmente se puede mover a un Data Warehouse en Fabric, donde puedes usar Stored Procedures en T-SQL con compatibilidad parcial.