title: SQL - How to ALTER COLUMN on a computed column
body: <p>I'm working with SQL Server 2008.  Is it possible to alter a computed column without actually dropping the column and then adding it again (which I can get to work)? For example, I have this table:</p>
  
  <pre><code>CREATE TABLE [dbo].[Prices](
  [Price] [numeric](8,3) NOT NULL,
  [AdjPrice] AS [Price] / [AdjFactor],
  [AdjFactor] [numeric](8,3) NOT NULL)
  </code></pre>
  
  <p>Later realizing that I have a potential divide by zero error I want to alter the [Adjprice] column to handle this, but if I just drop the column and add it again, I lose the column order.</p>
  
  <p>I want to do something like:</p>
  
  <pre><code>ALTER TABLE dbo.[Prices]
  ALTER COLUMN [AdjPrice] AS (CASE WHEN [AdjFactor] = 0 THEN 0 ELSE [Price] / [AdjFactor] END)
  </code></pre>
  
  <p>But this isn't correct.  If this is possible, or there is another solution, I would appreciate the help.</p>