Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How come the message "Table is marked for deletion" keeps appearing?

Using SQL Server 2008 and I'm doing some schema construction in the Management Studio designer.

I created a table early in the process called "Animal", but then decided to delete shortly after. I deleted it via the tree view in Management Studio (right-click delete).

Now I'm late in the process, I would like to recreate the table "Animal" but with different fields.

The second time round with Animal gets created fine, but when I try to add the table to my diagram I get the message "Table 'Animal' is marked for deletion, can't be added to the diagram or opened in the table designer".

What's the deal? How can I use this table normally again and not suffer from older table naming conflicts?

Alternatively, if the table is marked for deletion, can I actually invoke deletion somehow? Then recreate another table with the same name.

This is a little annoying. Would appreciate any help.

like image 313
CVertex Avatar asked Mar 25 '09 12:03

CVertex


People also ask

What is the best way to avoid the accidental deletion of entire tables?

One of the effective ways that can prevent accidental DML operations on SQL Server Table is to create a trigger on important table that contain crucial data. These triggers are also called as Prevention triggers. We can use triggers to prevent both accidental UPDATE or DELETE operations.

What will happen to view if table is deleted?

Dropping a table removes the table definition from the data dictionary. All rows of the table are no longer accessible. All indexes and triggers associated with a table are dropped. All views and PL/SQL program units dependent on a dropped table remain, yet become invalid (not usable).

What is deleting a table?

When you delete a table, the database deletes the data and dependent objects of the table (such as indexes), and removes the table from the data dictionary.

What does DELETE from table name do?

The DELETE statement is used to delete existing records in a table.


1 Answers

I was able to fix this problem by closing SQL Management Studio and re-opening it. I bet simply severing the connection to the server and reinstating it would work.

like image 186
Brian Avatar answered Oct 19 '22 13:10

Brian