Forum Discussion
Can notebooks trigger SQL stored procedures in 2026?
- 2 months ago
Hi arpost
The way I would approach this is to use a data pipeline or a pipeline where you could have the first 5 cells in your notebook running something. Once that completes, you then execute the stored procedures followed by the next step where you have another notebook which concretes the additional cells in your notebook. This way it'll also allow you to know if something fails in the pipeline, where it is failed, or easier troubleshooting and potentially. Problem solving.
- 2 months ago
I agree with GilbertQ about calling notebooks and stored procs from a pipeline as you have better control.
If you must call the stored proc from the notebook, they have released a feature that's in preview.
Make sure its a "python" notebook (not pyspark (python)).
You will have to pass the magic command as follows:
%%tsql -artifact NameOfYourFabricWarehouse -type Warehouse -bind df1You can find more details here: https://learn.microsoft.com/en-us/fabric/data-engineering/tsql-magic-command-notebook#using-t-sql-magic-command-to-query-fabric-data-warehouse
If you like my answer, please gives a thumbs up. If I have answered you correctly, please mark this as a solution.
Best Regards,
Rajesh
Hi arpost
The way I would approach this is to use a data pipeline or a pipeline where you could have the first 5 cells in your notebook running something. Once that completes, you then execute the stored procedures followed by the next step where you have another notebook which concretes the additional cells in your notebook. This way it'll also allow you to know if something fails in the pipeline, where it is failed, or easier troubleshooting and potentially. Problem solving.
- BrandonHart1 month agoAdvocate I
By the way, learning the hard way from experience. I recommend to almost always wrap your notebooks in a Pipeline. It gives you extra control such as set execution timeouts.