Posted by Dan Guzman on 03/08/07 12:46
> So say and update updates TABLE_A and I stop it, whilst this
> transaction is rolling back I attempt to rename TABLE_A to TABLE_A_OLD
> and rename a different table to become TABLE_A. I am assuming that
> the rollback actions will use the object reference of TABLE_A_OLD and
> continue to rollback the effects on the correct table and not corrupt
> 'new' TABLE_A... or will it not allow me to rename TABLE_A until the
> rollback is complete?
I would expect that the rename will be blocked until the rollback completes.
The rename requires a schema modification lock, which is incompatible with
the locks held on TABLE_A by the open transaction.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"cheesey_toastie" <bletchley_scum@yahoo.co.uk> wrote in message
news:1173354816.121044.292670@h3g2000cwc.googlegroups.com...
>I have a long query which I have set off and would like to stop, and
> rename one of the tables used.
>
> My query is due to my lack of understanding of the underlying
> structure of MSSQL-Server...
>
> So say and update updates TABLE_A and I stop it, whilst this
> transaction is rolling back I attempt to rename TABLE_A to TABLE_A_OLD
> and rename a different table to become TABLE_A. I am assuming that
> the rollback actions will use the object reference of TABLE_A_OLD and
> continue to rollback the effects on the correct table and not corrupt
> 'new' TABLE_A... or will it not allow me to rename TABLE_A until the
> rollback is complete?
>
> Thanks for any help!
>
> Steve
>
[Back to original message]
|