Restore Column or Table

  • There was an update statement run on our report table, which updated all the records instead of one. The sad part is that the changes were committed. Its a SQL 2000 on Sp4 database. Backup is with Litespeed. Should I use object recovery feature of Litespeed to restore the table or should I create a new database, restore it to a point in time and just copy that table..Also, can I just copy the singe column?? if so how? please advise

    Thanks!!

    The_SQL_DBA
    MCTS

    "Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."

  • I've never used litespeed, but if you restore to a new DB you can just run an update statement across DB's using the PK's to update the single column.

  • how would an update be on the PK column? Will my life be easier if I use DTS and copy the table, the data in it is static so we'll be fine with the changes from the last backup..thanks!!

    The_SQL_DBA
    MCTS

    "Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."

  • The_SQL_DBA (11/21/2008)


    how would an update be on the PK column? Will my life be easier if I use DTS and copy the table, the data in it is static so we'll be fine with the changes from the last backup..thanks!!

    I meant using the PK as a join. Like:

    Update T

    Set Column = T2.column

    From

    db1.dbo.table T Join

    db2.dbo.table T2 On

    T.pk = T2.pk

  • I ran this replacing the table and db names with the ones i have on the destination database. It says 20 rows affected but does not reflect those changes on the table? Am I missing something? Thanks!!

    The_SQL_DBA
    MCTS

    "Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."

  • The update I ran is this:

    Update dbo.ReportblCust

    Set ValidMsgDisp = ReportblCust.ValidMsgDisp

    From

    ReportData_DPS.dbo.ReportblCust Join

    ReportData_DPSTest.dbo.ReportblCust On

    ReportblCust.RptID =ReportblCust.RptID

    RptID is the primary key on both..

    Thanks!!

    The_SQL_DBA
    MCTS

    "Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."

  • Are you sure the point you restored to was BEFORE the update?

  • Yes, I restore to a point in time before the update..Thanks!!

    The_SQL_DBA
    MCTS

    "Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."

  • Run this:

    Update dbo.ReportblCust

    Set ValidMsgDisp = Source.ValidMsgDisp

    From

    ReportData_DPS.dbo.ReportblCust Dest Join

    ReportData_DPSTest.dbo.ReportblCust Source On

    Source.RptID =Dest.RptID

    Source: Restored database

    Dest: Current database

    HTH!

    MJ

Viewing 9 posts - 1 through 8 (of 8 total)

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