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.
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.
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).
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.
The DELETE statement is used to delete existing records in a table.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With