title: Rebuild canceled because of .mdf growth
body: <p>I have the Standard Edition of SQL Server 2012 and used a script to rebuild an index. I ran the query and then I saw that the <code>.mdf</code> file for the database started the grow a lot.</p>
  
  <p>I chose to cancel/stop my query that run the rebuild of the database.</p>
  
  <p>I checked in database what happened with the following queries:</p>
  
  <pre><code>SP_who2
  
  select cmd,* 
  from sys.sysprocesses
  where blocked &gt; 0
  </code></pre>
  
  <p>I saw that a process where blocked so I chose to kill that one.</p>
  
  <p>The query/spid became marked with cancel/roolback in <code>SP_who2</code>.</p>
  
  <p>It took a lot of time to rollback the query.</p>
  
  <p>The table that was rebuilding was a big with over 4 million rows and a fragmentation of 99%.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Why did the <code>.mdf</code> grow that fast? About 1 gb/(10/sec)</li>
  <li>When I stopped my query, can the database get inconsistent in any way?</li>
  <li>Can the data in the database have been changed because of this?</li>
  </ol>
  
  <p>Thanks in advance!</p>