I''ve just deleted my client DB

  • not joking, I've just did it (by mistake of course)

    I ran a sql script using QA and half of the tables are now empty.

    i produced the script with the enterprise manager and didn't check what it did.

    here is part of the script:

    /****** Object:  Table [dbo].[XXX]    Script Date: 29/12/04 18:26:01 ******/

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XXX]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

    drop table [dbo].[XXX]

    GO

    -----

    what do you think ?

  • 1.Any Full Backups ?

    2.What Recovery mode is the DB in?

     


    * Noel

  • well, i just got the job, i hope they backup daily

    any idea what this script do and why (beside the obivios of deleting the records)

  • It appears to be a copy of a script generated from a DTS where the DTS is supposed to drop the destination object if it exists because a new object with the same name is going to be placed in the database.  Gotta be careful with Drop, but obviously I don't have to tell you that anymore.

    c

    If the phone doesn't ring...It's me.

  • 1.find out what RECOVERY MODEL is the database in?

    To know that Run on QA the following replacing the letters in italics by the actual database name:

    select databasepropertyex('YOURDATABASENAME','Recovery')

    2. if it is Full there is hope, if it is SIMPLE you will have to restore from backups

     

    3. the above script is the introductory part for RECREATING the table that was DROPPED (Not erased ) after that usually follows the Create Table statement.

     


    * Noel

  • thanks for you reply,

    i can only check the recovery model tomorrow (it's 21:25 here in israel) i've executed the script with a remote connection and now i don't have it anymore (guess why).

    but if i am lucky as you say - what should i do ?

    what's the difference between "DROP" and erasing the records ?

    thanks

  • DROP = throwing the bucket away.

    ERASE/DELETE/TRUNCATE = emptying the water in the bucket



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply