Xiaowei
Xiaowei

Reputation:

Stop SQL Server 2005 Rebuild index

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

Thanks

Upvotes: 3

Views: 5213

Answers (2)

SqlRyan
SqlRyan

Reputation: 33914

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.

Upvotes: 0

mrdenny
mrdenny

Reputation: 5078

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.

Upvotes: 2

Related Questions