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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
cw88
Helper IV
Helper IV

Create lakehouse tables with script

Hi, 

i use lakehouse tables as bronze layer, as destination for pipelines with source csv files. This lakehouse tables are the base for views in my warehouse. (create view warehouse.dbo.testview as select * from lakehouse.dbo.testtable...) 

 

I want to create a new workspace with my warehouse and lakehouse. The objects in the warehouse are created by sql scripts, but i can't create the views because the lakehouse tables don't exist.

Now the question: Is it possible to create empty lakehouse tables with a script? Or do i have to run the pipelines first to create the tables?

Thanks!

1 ACCEPTED SOLUTION
R1k91
Super User
Super User

doens't work for you to run a notebook that creates tables?

 

 

 

%%sql
CREATE TABLE mytable (
    f1 INT,
    f2 VARCHAR(10)
)

CREATE TABLE mytable2 (
    f1 INT,
    f2 VARCHAR(10)
)

CREATE TABLE mytable3 (
    f1 INT,
    f2 VARCHAR(10)
)

 

 

 

--
Riccardo Perico
BI Architect @ Lucient Italia | Microsoft MVP

Blog | GitHub

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
R1k91
Super User
Super User

doens't work for you to run a notebook that creates tables?

 

 

 

%%sql
CREATE TABLE mytable (
    f1 INT,
    f2 VARCHAR(10)
)

CREATE TABLE mytable2 (
    f1 INT,
    f2 VARCHAR(10)
)

CREATE TABLE mytable3 (
    f1 INT,
    f2 VARCHAR(10)
)

 

 

 

--
Riccardo Perico
BI Architect @ Lucient Italia | Microsoft MVP

Blog | GitHub

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@R1k91 : Thanks, i will try it 🙂

Anonymous
Not applicable

@R1k91 : It works for me! I need to change some data types (bit -> boolean, datetime2 -> timestamp).

Thanks!

Anonymous
Not applicable

Hi @cw88 , @Anonymous 

Glad to know that your query got resolved. Please continue using Fabric Community for your further queries.

Anonymous
Not applicable

Hello @cw88 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
In case if you have any resolution please do share that same with the community as it can be helpful to others .
If you have any question relating to the current thread, please do let us know and we will try out best to help you.
In case if you have any other question on a different issue, we request you to open a new thread .

Anonymous
Not applicable

Hi @cw88 ,

Thanks for using Fabric Community.
As @R1k91 said we can create tables in lakehouse using Spark SQL in Fabric Notebooks.

You can also refer this doc for more details -
Working with tables in Microsoft Fabric Lakehouse - Everything you need to know! - Data Mozart (data...

Hope this is helpful. Please let me know incase of further queries.

Anonymous
Not applicable

Hello @cw88 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .

Helpful resources

Announcements
FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Fabric Update Carousel

Fabric Monthly Update - March 2026

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

Top Kudoed Authors