views:

129

answers:

2

Can I stop SQL Server reorganising and rebuilding index task while it is still going?

Thanks

A: 

yes you can. A rebuild will rollback and the index will be in the exact state it was in before the rebuild was started. A reord (aka defrag) will stop where it is, and start back up where it left off (or pretty close at least) the next time you start it.

I actually have a job which looks to see if my maintenance job is running, and stops it if it is come 5am.

mrdenny
A: 

you can stop the SQL Agent job, or you can kill the SPID that's running the rebuild. In both cases, it should roll back the changes, so the table may not be immediately available.

rwmnau