I have a SQL Server 2008 database. This database has a Table called \"Book\". \"Book\" has the following properties:
You can define the column in your CREATE TABLE
as:
AgeInMinutes as (DATEDIFF(minute, PublishDate, GETDATE())
Alternatively, just do
ALTER TABLE Book
ADD AgeInMinutes as (DATEDIFF(minute, PublishDate, GETDATE())
Modify computed column through SSMS. Right click on table and select Design then click on computed column then see in column properties there is one option like. Computed column specification there you can alter COMPUTED COLUMN.