title: How do I drop a column with object dependencies in SQL Server 2008?
body: <p>The error message I'm obtaining when trying to drop a column:</p>
  <blockquote>
  <p>The object 'defEmptyString' is dependent on column 'fkKeywordRolleKontakt'.</p>
  <p>Msg 5074, Level 16, State 1, Line 43</p>
  <p>ALTER TABLE DROP COLUMN fkKeywordRolleKontakt failed because one or more objects access this column.</p>
  </blockquote>
  <p>I have already tried to find the default constraints, as described here:
  <a href="https://stackoverflow.com/questions/314998/sql-server-2005-drop-column-with-constraints">SQL Server 2005 drop column with constraints</a></p>
  <p>Unfortunately without any success :( The line returned is:</p>
  <pre><code>fkKeywordRolleKontakt 2 814625945 0 defEmptyString
  </code></pre>
  <p>And I cannot remove either of <code>fkKeywordRolleKontakt</code> and <code>defEmptyString</code>.</p>
  <p>What is the correct way to get rid of this dependency?</p>
  <p>EDIT: Perhaps this is of importance too. The column fkKeywordRolleKontakt is of type udKeyword (nvarchar(50)) with default <code>dbo.defEmptyString</code>.</p>
  <p><br /><b>Edit 2: Solved</b></p>
  <p>I could solve the problem now. I'm sorry, I did not copy the full error message, which was:</p>
  <p><code>Msg 5074, Level 16, State 1, Line 1<br />
  The object 'defEmptyString' is dependent on column 'fkKeywordRolleKontakt'.<br />
  Msg 5074, Level 16, State 1, Line 1<br />
  The object 'FK_tlkpRolleKontakt_tlkpKeyword' is dependent on column 'fkKeywordRolleKontakt'.<br />
  Msg 4922, Level 16, State 9, Line 1<br />
  ALTER TABLE DROP COLUMN fkKeywordRolleKontakt failed because one or more objects access this column.</code></p>
  <p>I could generate a script to drop the column by right-clicking on the column entry (dbo.tlkpRolleKontakt &gt; Columns &gt; fkKeywordRolleKontakt) (in MSSQL Server Manager), selecting Modify and deleting the column. Then Table Designer &gt; Generate Change Script generated the necessary commands:</p>
  <pre><code>ALTER TABLE dbo.tlkpRolleKontakt
      DROP CONSTRAINT FK_tlkpRolleKontakt_tlkpKeyword
  EXECUTE sp_unbindefault N'dbo.tlkpRolleKontakt.fkKeywordRolleKontakt'
  ALTER TABLE dbo.tlkpRolleKontakt
      DROP COLUMN fkKeywordRolleKontakt
  </code></pre>
  <p>That's it :)</p>