How do you add a computed column to a Table?

Chris Pfohl picture Chris Pfohl · Jun 15, 2012 · Viewed 70k times · Source

How can I add a computed column to a table that already exists? S.O. has Computed Column Help - TSQL but no information about adding them.

Answer

Chris Pfohl picture Chris Pfohl · Jun 15, 2012

The syntax I was looking for is:

alter table TABLE_NAME
add [column_name] as (**COLUMN-SQL**)