none
Table "Animal" Marked for deletion

    Question

  • 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.


    Regards,

    CV


    UPDATE: I've tried the same process several times and it still won't get added to the diagram.


    CV
    Thursday, March 26, 2009 7:21 AM

All replies

  • Hello,

    Delete the 'Animal' table from Tables folder in the data base.
    It works fine.

    Thanks,
    Prashanthi
    Thursday, March 26, 2009 8:48 AM
  • Hi CV,

    Before you create a second table ,try using the following command

    use

     

    database
    go
    select * from sys.sysobjects where name like 'animal' and xtype like 'u'

    and then use drop table command again and now try creating ur new table with the same name.

    Also make a note of object id that is being created everytime for the same name with which u create tables . it should be different.

    Thanks,
    Leks

    Monday, March 30, 2009 10:15 PM
    Answerer