restoring only one column

  • Hi all,

    Can we restore only a single column instead of whole database?

    We took backup later other teams made some changes to the database,I tried to update a column to change few records but then almost 10000 records got updated . As other teams worked on the same table ,I don't want to restore the whole database.Can I just restore the column.?

  • Not directly.

    Restore the backup as a new database and use UPDATE to get the values as you want them.

    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
  • sreeya (8/28/2009)


    Hi all,

    Can we restore only a single column instead of whole database?

    We took backup later other teams made some changes to the database,I tried to update a column to change few records but then almost 10000 records got updated . As other teams worked on the same table ,I don't want to restore the whole database.Can I just restore the column.?

    Next time, when updating data, do this:

    begin tran

    update tableA set columnA = 'NewValue'

    then verify the expected record count

    if correct COMMIT

    if suspect ROLLBACK

    But DON'T forget to either commit or rollback !!!

  • Rule #33: Never ever run neither DML nor DDL against production without having successfully tested it before.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • PaulB (8/29/2009)


    Rule #33: Never ever run neither DML nor DDL against production without having successfully tested it before.

    Shoot... that's rule #1 for me.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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