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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Unable to read SQL Endpoint view into a Notebook dataframe

Hi All,

We are seeking to use a view within a SQL analytics Endpoint as a source of data for a dataframe in a notebook.

When we seek to query it, we see an error like  [TABLE_OR_VIEW_NOT_FOUND]

code looks like this. The view is under the DBO schema.

 

df = spark.sql("SELECT * FROM lakehousename.viewname LIMIT 1000")
display(df)

 



Is this possible? I feel like it wont be :*(  but staying positive.

Thanks! 

1 ACCEPTED SOLUTION
AndyDDC
Valued Contributor

Hi @Anonymous no I don't believe this will work as the View has been created using the SQL Analytics endpoint, there is no metadata sync from the SQL Endpoint to the Lakehouse (it's the other way round). 

 

You could use JDBC connector in the Notebook to query the View in the SQL Endpoint, or create the View in the Lakehouse using Spark.

 

edit: I believe pyodbc would work here 

View solution in original post

6 REPLIES 6
AndyDDC
Valued Contributor

Hi @Anonymous no I don't believe this will work as the View has been created using the SQL Analytics endpoint, there is no metadata sync from the SQL Endpoint to the Lakehouse (it's the other way round). 

 

You could use JDBC connector in the Notebook to query the View in the SQL Endpoint, or create the View in the Lakehouse using Spark.

 

edit: I believe pyodbc would work here 

SorenSparso
New Contributor II

Hi,

Do you know how to get the authentication to work in the SQL endpoint? I have tried different combinations of below statement, but it is not working:

df = spark.read\
    .format("jdbc") \
    .option("url", f"jdbc:sqlserver://***.datawarehouse.pbidedicated.windows.net:1433;database=***") \
    .option("dbtable", "someTable") \
    .option("authentication", "ActiveDirectoryIntegrated") \
    .option("encrypt", "true") \
    .option("clientid", "***") \
    .option("hostNameInCertificate", "*.pbidedicated.windows.net") \
    .load()
display(df)
 
Thanks ๐Ÿ™‚
AndyDDC
Valued Contributor
SorenSparso
New Contributor II

Hi, 

Yes, that helped, thanks ๐Ÿ™‚

I had to add the serviceprincipal to the workspace (CREATE USER is not a supported statement type.) but after that, I can now read views in a Lakehouse from a Notebook.

Hi, 

I can read data by using pyodbc package from endpoint. Now I would like to store these results in a delta table in lakehouse... is this possible?

 

Thank you ๐Ÿ˜„ 

daanblinde
New Contributor

having the same issue here. a lot of people out there use sql statements stored in views to create there ETL logic. would be very nice if microsoft is going to support the possibility to read from views in a notebook. I came across the following example using the spark connector which works for me perfect as a workaround. https://fabric.guru/querying-sql-endpoint-of-fabric-lakehousewarehouse-in-a-notebook-with-t-sql

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Free Fabric Certifications

Free Fabric Certifications

Get Fabric certified for free! Don't miss your chance.

January Fabric Update Carousel

Fabric Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (9,271)