Forum Discussion

cw88's avatar
cw88
Helper IV
2 years ago
Solved

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!

  • 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)
    )

     

     

     

7 Replies

  • 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)
    )

     

     

     
      • Anonymous's avatar
        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 .

      • Anonymous's avatar
        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 .