Forum Discussion
Unable to create table in lakehouse SQL endpoint
- 1 year ago
Hello Jaganath
suparnababu8 is absolutely right
You can’t create or alter Lakehouse tables through the Lakehouse SQL endpoint; it’s read-only for T-SQL DDL statements. Even if you’re a workspace admin, table creation there is blocked. Instead, you could:
Use a Warehouse
3. If your goal is to handle staging or temp tables with T-SQL statements, do it in a Warehouse, where T-SQL CREATE TABLE or CREATE TEMPORARY TABLE operations are allowed.
2. Use Spark Notebooks
In a Lakehouse, DDL changes require Spark. For instance:# Create a table in Lakehouse from a notebook
df.write.format("delta").mode("overwrite").saveAsTable("myLakehouseTable")If you need a temporary table specifically to handle SCD logic, move that logic to a Warehouse or keep it in Spark so that creation of the intermediate table is permitted
hope this helps
thanks
Hello Jaganath
suparnababu8 is absolutely right
You can’t create or alter Lakehouse tables through the Lakehouse SQL endpoint; it’s read-only for T-SQL DDL statements. Even if you’re a workspace admin, table creation there is blocked. Instead, you could:
Use a Warehouse
3. If your goal is to handle staging or temp tables with T-SQL statements, do it in a Warehouse, where T-SQL CREATE TABLE or CREATE TEMPORARY TABLE operations are allowed.
2. Use Spark Notebooks
In a Lakehouse, DDL changes require Spark. For instance:
# Create a table in Lakehouse from a notebook
df.write.format("delta").mode("overwrite").saveAsTable("myLakehouseTable")
If you need a temporary table specifically to handle SCD logic, move that logic to a Warehouse or keep it in Spark so that creation of the intermediate table is permitted
hope this helps
thanks
- v-aatheeque1 year ago
Community Support
Hi Jaganath ,
The answer provided by nilendraFabric suparnababu8 has resolved your issue? If so, kindly mark the helpful reply as the accepted solution. This will help other community members with similar concerns find solutions more efficiently.
Thank you for your cooperation!"