title: How to remove a field from SQLServer2005 table
body: <p>I tried this:</p>
  
  <pre><code>ALTER TABLE My.Table DROP MyField
  </code></pre>
  
  <p>and got this error:</p>
  
  <p>-MyField is not a constraint.</p>
  
  <p>-Could not drop constraint. See previous errors.</p>
  
  <p>There is just one row of data in the table and the field was just added.</p>
  
  <p><strong>EDIT:</strong>
  Just to follow up, the sql was missing COLUMN indeed.
  Now I get even more seriously looking errors though:</p>
  
  <ul>
  <li>The object 'some_object__somenumbers' is dependent on column 'MyField'</li>
  <li>ALTER TABLE DROP COLUMN MyField failed because one or more objects access this column.</li>
  </ul>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>ALTER TABLE TableName DROP Constraint ConstraintName
  </code></pre>
  
  <p>worked, after that I was able to use the previous code to remove the column. Credit goes to both of you, thanks.</p>