A calculated column is a powerful feature where it represent the predefined expression
like a view does. Like a view, The calculated column does not store any value actually,
instead, the data is calculated only when a query is executed.
it helps in maintaining data integrity by doing calculations at the table level rather than
having the hope that each and every developer would get the calculations correct.
They can even be indexed.
The syntax is opposite to that of the column alias;
ColumnName as Expression
The Employee table from the Database "adsingh" has a calculated column for the extended
salary as shown in the following code
CREATE TABLE dbo.EmployeeDetail(
MonthlySalary AS DaysWorked * DaySalary Persisted
Calculated Column will be persisted on the disk with Sql Server 2005.
This will most importantly improves the performance in the calculated column
when a search is done.