Forum Discussion

jkalkbrenner's avatar
jkalkbrenner
Frequent Visitor
3 years ago
Solved

Fabric Lakehouse Drop Table

I receive the below error when I run 'drop table [dbo].[tablename]' in a Lakehouse.
What am I doing wrong?

 

Msg 368, Level 14, State 1, Line 1
The external policy action 'Microsoft.Sql/Sqlservers/Databases/Schemas/Tables/Drop' was denied on the requested resource.
Msg 3701, Level 14, State 20, Line 1
Cannot drop the table '<table name>', because it does not exist or you do not have permission.
Statement ID: {EDB6B91A-18D2-4654-A0D0-7C8771B934A7}

Completion time: 2023-06-28T16:02:43.1676935-04:00

  • Hi jkalkbrenner 

     

    In order to drop a table in the Lakehouse you have to use a Notebook to do this. The SQL Endpoint for a lakehouse is ready only.

     

    Here it the code to do this in the Notebook

    # Syntax of DROP
    DROP TABLE tableName

6 Replies

  • Hi jkalkbrenner 

     

    In order to drop a table in the Lakehouse you have to use a Notebook to do this. The SQL Endpoint for a lakehouse is ready only.

     

    Here it the code to do this in the Notebook

    # Syntax of DROP
    DROP TABLE tableName
    • jkalkbrenner's avatar
      jkalkbrenner
      Frequent Visitor

      Thank you GilbertQ !
      Spark SQL did indeed drop the table!

      drop table <lakehousename>.<tablename>
    • hello_'s avatar
      hello_
      Icon for Helper I rankHelper I

      Hello GilbertQ I am having this same error in CREATE command and don't know how to use Notebook in wharehouse (SQLEndpoint) 

      Could you please assist me

      • GilbertQ's avatar
        GilbertQ
        Icon for Super User rankSuper User

        Hi hello_ 

         

        If you are using the Warehouse then you will have to do it in the Warehouse view.