restoring a single table from database in sqlserver 2000

  • Hi

    how to restore a single table from my database( i have a 50 tables in my TSTDB data base ,one table got corrupted so need to restore only that perticular corupted table in sqlserver 2000

    any boby pls give the quick solution

    Thanks in advance

    restoring a single table from database in sqlserver 2000

  • Corrupted table as in database corruption? (and if so, what are the errors?)

    There's no way with the native tools to restore a single table. You can restore file, filegroup or database (the first two only if you have log backups up to present). SQL 2005 introduced page-level restore, but that's not an option in SQL 2000.

    Usually to restore a table, one would restore the DB alongside the existing one and then copy the table over. May not help if there's corruption though.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi Gail,

    Thanks for u r valuble suggession,

    as per your reply i mean

    if i want to restore single table in my database i need to restore entire database.?

    i tried the same but if i try to restore entire database with other name

    it is saying database is in use u cannot restore

    at this situation what to do

    pls provide clear solution or any link regarding this in sqlserver 2000

    Thanks

  • Yes, there's no single table restore in the native SQL tools. Some 3rd party backup tools (like litespeed) can.

    You need to restore the backup as a new database, not one that exists already. Just use the usual restore command and specify a name for the DB that isn't the name of any existing DB. You'll also have to change the file locations (can't remember where to do that in SQL 2000) so that it doesn't try to overwrite the existing tools.

    Easiest is to use script

    RESTORE DATABASE TempVersionOfDB FROM Disk = <Backup location>

    WITH MOVE <rest of the move clause >

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks now i got it

Viewing 5 posts - 1 through 4 (of 4 total)

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