title: Error handling and data integrity when changing table schema
body: <p>We have a few customers with large data sets and during our upgrade procedure we need to modify the schema of various tables (adding some columns, renaming others, occasionally changing data types, but that's rare).</p>
  
  <p>Previously we've been going via a temporary table with the new schema, and then dropping the original and renaming the temp table but I'm hoping to speed that up dramatically by using <code>ALTER table ...</code> instead.</p>
  
  <p>My question is what data integrity and error handling issues do I need to consider? Should I enclose all changes to a table in a transaction (and if so, how?) or will the DBMS guarantee atomicity and integrity over an ALTER operation?</p>
  
  <p>We already heavily recommend customers backup their data before starting the upgrade so that should always be a fall back option.</p>
  
  <p>We need to target SQLServer 2005 and Oracle, but obviously I can add conditional code if they require different approaches.</p>