59

I've created a table and then realised I made a mistake. SSMS wouldn't let me update the table without recreating it, so I've deleted the table and then tried to create it again.

It won't let me do this, and I get an error dialog

Table 'dbo.Foo' already exists.

So I try to delete it again:

drop table dbo.Foo

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

Refreshing the IntelliSense cache does not help.

7 Answers 7

113

Closing and restarting SSMS seems to be the only way to get rid of the error. After doing so, I can again successfully create the table.

8
  • 24
    3 years later, the problem is still here... Why does that bug has't been resolved yet ?
    – AlexB
    Jul 3, 2016 at 15:07
  • 3
    Its still there in SSMS 2016 Dec 7, 2016 at 16:20
  • 1
    yup. 2017, still here. this is the only working answer. Can't wait to switch to mysql.
    – Barry
    Apr 20, 2017 at 22:00
  • 2
    It's 2020. I just spent a couple wasted hours trying to figure out why I couldn't re-create a table. Thanks for this answer! Now, I'd like to ask M$ what the actual (beep) already, but they seem to have their hands full deploying broken windows 10 updates. Maybe in 5 more years?
    – Redgum
    Aug 26, 2020 at 4:27
  • 3
    2022 and it still doesnt work...
    – Nigel
    Jan 26, 2022 at 0:02
23

Create the Table with any other name and then rename it works fine. Server refresh did not work for me. You can try to restart Management Studios though.

2
  • You just saved me a lot of swearing right at the end of the week :) Thanks!
    – Koenman
    May 10, 2019 at 13:33
  • Worked for me! Much better/faster than a full restart of SSMS and loss of your new table specification requiring you to start all over. May 31, 2019 at 16:00
9

I was having the same problem. Right-click on your server connection and select 'Refresh'. I did this and was able to save the recreated table without restarting SSMS.

0
8

To change this, on the Tools menu, click Options, expand Designers, and then click Table and Database Designers. Select or clear the Prevent saving changes that require the table to be re-created check box.

1
  • 1
    I should add that this is not a safe option for production environments or editing databases with pre-existing data. But I won't lie - it solved the problem!
    – Horkrine
    Sep 2, 2018 at 0:33
7

I found that you just need to close all the 'delete's table' TAB from SSMS and it's done

0
1

Make sure that you have no non-saved table changes (better to close all tabulators and try it again)

1

Right-click on the Server, click on Refresh and try again! Worked like a charm for me. Hope the same works for you as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.