title: Changing columns from INT to BIGINT in different tables
body: <p>I have a situation where I need to change a column from INT to BIGINT in different tables. The problem is that some of these tables have constraint, indexes, keys and data in it; and some of them are related one to another.
  I created a series of steps to do to perform this job, and I will appreciate your opinions.</p>
  
  <ol>
  <li><p>Identify the columns on the tables. 
  SELECT SCHEMA_NAME(schema_id) AS schema_name, t.name AS table_name, c.name AS column_name FROM sys.tables AS t INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID WHERE 1=1 AND c.name LIKE '%columnname%' ORDER BY schema_name, table_name;</p></li>
  <li><p>Pick a table and generate script to create and drop on each constraint, keys and index.</p></li>
  <li><p>Create a new table with identical structure as the picked table but creating the desired column as a BIGINT instead of INT.</p></li>
  <li><p>Insert the rows from the old table into the new table.</p></li>
  <li><p>Run the DROP scripts for each constraint, keys and index in the old table.</p></li>
  <li><p>DELETE all the rows in the old table.</p></li>
  <li><p>Alter the old table to modify the desired column from INT to BIGINT.</p></li>
  <li><p>Run the CREATE scripts for each constraint, keys and index in the old table.</p></li>
  <li><p>Insert the rows from the new table to the old table.</p></li>
  <li><p>Go to step 2, chose another table and repeat.</p></li>
  </ol>
  
  <p>Do you think this is a good plan? I also appreciate any recommendation for a backup plan.</p>