What happens if SSMS is force-closed by an RDP logoff while adding a column?

  • So I was tasked with adding an Identity column to a very large table this weekend. Yesterday it failed because the Transaction Log ran out of room (DB is in simple recovery.) So I re-set things up today, gave the TLog an extra file on another disk to try to prevent the out-of-log-space error, and fired off the alter table command.

    And went to get breakfast.

    And had the GPO enforced RDP log off kick in while I was gone.

    Forcing SSMS to close (I was RDPed into the server.)

    It looks like my alter table might still be running (based on sys.dm_exec_requests and grabbing the text from sys.dm_exec_sql_text) but is there any way to be sure? Exec_Requests currently shows the process as suspended with a wait_type of pageiolatch_ex, so I'm presuming it's waiting on the disk system before continuing.

    Any help?

    Jason

  • If the connection was closed before the operation completed, it will have rolled back (or be in the process of rolling back)

    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 (5/5/2013)


    If the connection was closed before the operation completed, it will have rolled back (or be in the process of rolling back)

    Frak.

    OK, thanks Gail, that's what I thought might be going on, and just wanted to be sure.

    Going to set this up to run as an Agent job instead, this time...

    Jason

  • If you want to check, you can run

    KILL <session_id> WITH STATUSONLY

    Run that on a session that's not rolling back and you get an error. Run it on one that is rolling back and you get an estimate of rollback completion.

    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

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

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