DROP EXTERNAL TABLE not working

Kyle Macdonald (ALT) 26 Reputation points
2022-03-02T20:22:46.227+00:00

In our ETL, we have a stage schema, we use to create external tables for temporary purposes. Something happened downstream in our pipeline, that caused us to re-run the pipeline & recreate the external table.

Our workflow is to drop the external table, and recreate it again. Attempting to drop the table results in failure though.

179392-image.png

The table exists in sys.objects though, but we're unable to see it in our navigation pane.

179249-image.png

The table was created with our service account, like all our other ETL tables. Attempting to drop the table with the service account yields the failure, same with our admin account.

NOTE: The reason the pipeline initially failed was due to a query timeout when creating the table. I'm thinking, after the query timed out, it now exists in some broken state?

This has happened twice now over the course of the last few days, and never before have I've seen this. Open to any ideas!

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,901 questions
0 comments No comments
{count} votes

Accepted answer
  1. AnnuKumari-MSFT 32,826 Reputation points Microsoft Employee
    2022-03-04T13:16:14.677+00:00

    Hi @Kyle Macdonald (ALT) ,
    Thankyou for using Microsoft Q&A platform and posting your query.
    As I understand your issue here is that you want to drop an external table in either dedicated SQL pool or Serverless SQL pool. But it's throwing error saying either table doesn't exist or you don't have sufficient permission.

    In my understanding , the problem here might be that the window in which you are running the SQL script is not connected to the database where you actually have that table.

    Please consider revisiting if you are connected to correct database by looking at the top of the panel. Check for the SQL pool as well as database. 180136-image.png

    If it looks good, try using the command before drop external table command :

    Use <DatabaseName> ;  
    

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

1 additional answer

Sort by: Most helpful
  1. AaronHughes 391 Reputation points
    2022-03-03T11:37:44.97+00:00

    this error isnt about it not existing its about the account your using to drop it not have the privs to do so

    find out what privs the account your using has on the schema / object

    you may need to get dba to drop it for you or grant you the correct privs to complete the action


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.