title: SQL - Convert column data type from varchar to bigint with dependencies
body: <p><strong>Question:</strong> <br/>
  Without losing any data, how can I:<br/><br/> 
  <strong>#1.</strong> Convert column data type from Varchar to Bigint?</p>
  
  <p>Let's say:</p>
  
  <p>table1.my_ID = "12345"  // default is varchar</p>
  
  <p>change into:</p>
  
  <p>table1.my_ID = 12345  // convert to bigint<br/><br/> </p>
  
  <p><strong>#2.</strong> ..and how can I do this if my table has a lot of dependencies?</p>
  
  <p>I tried ALTER TABLE and ALTER COLUMN:</p>
  
  <pre><code>ALTER TABLE [MY_DATABASE].[dbo].table1
  ALTER COLUMN my_ID BIGINT
  </code></pre>
  
  <p>and I got these:</p>
  
  <blockquote>
    <p>Msg 5074, Level 16, State 1, Line 1<br/>
    The object 'PK_table1' is dependent on column 'my_ID'.<br/><br/>
    Msg 5074, Level 16, State 1, Line 1<br/>
    The object 'FK_table2_table1' is dependent on column 'my_ID'.<br/><br/>
    Msg 5074, Level 16, State 1, Line 1<br/>
    The object 'FK_table3_table1' is dependent on column 'my_ID'.<br/><br/>
    ..blah blah..<br/><br/>
    Msg 4922, Level 16, State 9, Line 1<br/>
    ALTER TABLE ALTER COLUMN my_ID failed because one or more
    objects access this column.</p>
  </blockquote>
  
  <p>Please help. <br/><br/>
  Thanks!</p>