TRUNCATE TABLE on Mirrored DB

  • I truncated a table in my mirrored training environment on Principle side.

    From what I remembered, TRUNCATE TABLE [tablename] is not a logged opereation.

    Will this cause problems on the Mirror side?

    Thanks!

  • TRUNCATE TABLE is logged. If you truncate the table on the principal side, it will get truncated on the mirror.

  • Truncate table is a logged operation (there are no unlogged data modifications in SQL). It can be rolled back, it can be mirrored. It's technically even a fully-logged operation.

    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
  • smallmoney (8/20/2012)


    I truncated a table in my mirrored training environment on Principle side.

    From what I remembered, TRUNCATE TABLE [tablename] is not a logged opereation.

    Will this cause problems on the Mirror side?

    Thanks!

    It is minimally logged operation but wrong to say that it is unlogged. Information is logged therefore it can even be rolled back if done inside a transaction where commit was no issued and a rollback was initiated due to some reason.

    Chandan

  • Technically it's not minimally logged. It doesn't behave as minimally logged operations do. It's fully logged, just as drop table is fully logged. Both of them log just the page deallocations.

    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
  • GilaMonster (8/27/2012)


    Technically it's not minimally logged. It doesn't behave as minimally logged operations do. It's fully logged, just as drop table is fully logged. Both of them log just the page deallocations.

    Thanks for using correct words for this situation and correcting my glitches.

    Chandan

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

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