Sql Server Management studio drop table and re-create issue

2.1k Views Asked by At

I have created a table with primary key and foreign key using SQL Server Management studio 2008R2, then I have drop the table using the sql command drop table nameofthetable and the table has been dropped. After that I have created another table with the same name of the dropped table but I get this error:

" The table 'name of my table' already exists'.

Why? I don't see the old table in my table list.

Can you help me, I need to create the table with this name?

2

There are 2 best solutions below

3
On

In the Object Explorer, right-click and Refresh the Tables list

0
On

Commit your changes before you recreate the table. You can also use the GO statement.