1

I have an Azure SQL DB database that I am copying data into from a source database using SSIS. My SSIS package for one table fails because it can't write to or create a specific table name (it is important to keep the same table names as in the source database). I attempted to address the problem via an SQL query, but

CREATE TABLE [schemaname].[tablename]

returns:

There is already an object named 'tablename' in the database.

and

DROP TABLE [tablename]

returns:

Cannot drop the table 'tablename', because it does not exist or you do not have permission.

I have had a look at a few posts where other people have had similar problems, but the solutions offered are either not possible in this situation or do not work: I am already accessing the database with the admin account, and there are no tables with the same name as this in any other schema either. Dropping the table if it exists gives the same error, and FLUSH TABLES seems to be MySQL-specific so does not work. Because it is an Azure database, I can't access the back-end filesystem, and the database is too large to easily move or copy anywhere else.

Does anyone have any ideas as to how to resolve this?

5
  • You need to wait for some time after that the deleted database would be completely deleted, this is what I have observed in Azure SQL database.
    – Shanky
    May 10, 2019 at 8:26
  • I deleted the table yesterday but the error is still occurring today, and I need to get the package built by the end of the day. Do you know how long it usually takes to recognise that the table doesn't exist?
    – Mel
    May 10, 2019 at 8:29
  • Why are you including the schema name in one but not the other? Can you try DROP but add the schema in? May 10, 2019 at 11:53
  • I tried both, neither worked. Eventually it let me create the table again, but I had to wait over 24 hours after dropping it, it was very odd.
    – Mel
    May 13, 2019 at 9:12
  • I have the same problem. I have only waited 10 minutes so far. I really want to use the same name, but I can't wait 24+ hours :-(. Mar 18, 2020 at 14:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.