If you have time to plan ahead, there's a much easier solution... (usually)
The long locks are almost certainly caused by page splits at the
storage layer. So force them on your own schedule.
- Add a NULL-able temporary column with datatype
- Find available slack time in the database to update batches of the existing records with a valid value for the field. (
0x0000000027F95A5B for example)
- The updates will force the necessary page splits and allocate more space to the table.
- When you're caught up, drop the temporary column (doesn't touch the allocated storage) and add the rowversion column.
- No page splits, and a lock that's needed only long enough to populate the values.
I've used this successfully to add a rowversion column to a 150M row table in under 10 minutes.
Caveat... if you have a table with large varchar fields (especially
varchar(max)) SQL Server decides to rebuild the table instead of re-using the newly available space. Still trying to figure out a way around that one.