title: SQL Server refactor a column from varchar(50) to uniqueidentifier and surrounding issues
body: <p>I have a table <code>message</code> in a database that has almost a million rows. It has a <code>externalId</code> column which is <code>varchar(50)</code>. The values stored in it are guid but I want to update this column to be <code>uniqueidentifier</code>.</p>
  
  <p>So I think I am going to add a new column which is <code>uniqueidentifier</code>. Copy all the values across to this column and then drop the original column. Then I will rename this column to <code>externalId</code>.</p>
  
  <p>My problem is there are hundreds of stored procs etc and I need to make sure that I don't break anything. I also have to grep through all the code and make changes so that we expect a Guid and not a string. (I am using C#)</p>
  
  <p>Does anyone have some tips or recommendations?</p>
  
  <p>Would I be better do just duplicate this column and not touch the existing column and make any code that does a select on it use the guid column instead of the string (currently it sometimes times-out!). I would also have to update any code then that inserts into this table to also insert a guid...)</p>
  
  <p>I love legacy crap .......................</p>