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

Join us at the 2025 Microsoft Fabric Community Conference. March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for $400 discount. Register now

Reply
AbiNyk
Frequent Visitor

Best Practice storage when using both sql and notebooks - warehouse or parquet

Hi,

 

I need to do some logic using stored procedures and afterwards notebooks consuming the resultSets. 

 

Since it is not easy to call stored procedures from a notebook (Fabric Data Warehouse connection) i thought of making my stored procedure logic directly in the Lakehouse using notebooks as a kind of stored procedures (Spark SQL), and then invoking these whenever needed.

 

But i am unsure if this is a good idea? What is best practice when you want to use SQL as much as possible but also need notebooks?

 

BR

1 ACCEPTED SOLUTION
frithjof_v
Super User
Super User

"i thought of making my stored procedure logic directly in the Lakehouse using notebooks as a kind of stored procedures (Spark SQL), and then invoking these whenever needed.

 

But i am unsure if this is a good idea?"

 

I think this is a good idea. Use Spark SQL and Lakehouse with Delta Table. Just try and see if it can solve your need. If it does, then I think this is the most efficient technology and a recommended way.

 

Please share if you stumble upon some specific roadblockers.

 

Remember to run OPTIMIZE and VACUUM at suitable intervals. In many cases, running OPTIMIZE and VACUUM once per day is a general okay solution. Depending on how often you make updates to the data tables.

View solution in original post

8 REPLIES 8
frithjof_v
Super User
Super User

"i thought of making my stored procedure logic directly in the Lakehouse using notebooks as a kind of stored procedures (Spark SQL), and then invoking these whenever needed.

 

But i am unsure if this is a good idea?"

 

I think this is a good idea. Use Spark SQL and Lakehouse with Delta Table. Just try and see if it can solve your need. If it does, then I think this is the most efficient technology and a recommended way.

 

Please share if you stumble upon some specific roadblockers.

 

Remember to run OPTIMIZE and VACUUM at suitable intervals. In many cases, running OPTIMIZE and VACUUM once per day is a general okay solution. Depending on how often you make updates to the data tables.

v-shex-msft
Community Support
Community Support

Hi @AbiNyk ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
tharunkumarRTK
Super User
Super User

@AbiNyk 

You can now run T-SQL from fabric notebooks

https://learn.microsoft.com/en-us/fabric/data-engineering/author-tsql-notebook

you can attach your warehouse to notebook and run t-sql 
I guess you can run stored procedures as well, you can give it a try

 

Need a Power BI Consultation? Hire me on Upwork

 

 

 

Connect on LinkedIn

 

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

Thanks for the reply and link.

 

It only shows how to make a simple query - not to execute a stored procedure. Do you know the syntax for calling a SP?

 

Further, i get a message on the DW: "This data source is not fully supported under the current global language." - Do you know what it means? 

 

 

FabianSchut
Super User
Super User

Hi @AbiNyk,

 

Another option is to write all SQL logic in a warehouse and use a shortcut in the lakehouse to the output tables from the warehouse. Then you are able to pick up the results from the stored procedures in the warehouse and use it for more transformations in the lakehouse.

The results are not to be written to tables but only consumed by the notebook. 

HI @AbiNyk,

>>Further, i get a message on the DW: "This data source is not fully supported under the current global language." 

I think this mean current you can not in the correspond language mode, so that not all type of function and command supported when you use notebook to execute with sql query.

Have you switch the notebook language mode to the t-sql ? After this operation, you can use exec command to invoke SP.

1.png

Data warehouse tutorial - transform data using a stored procedure - Microsoft Fabric | Microsoft Lea...

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Its in the connection/path area and not in the notebook:

AbiNyk_1-1729585253111.jpeg

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebFBC_Carousel

Fabric Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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