Articles → SQL SERVER → Computed Columns In SQL ServerComputed Columns In SQL ServerIn this article, we will discuss computed columns in SQL server.Purpose The computed column computes its value from a formula or an expression.Example In this example, we will create a table with 2 columns.Now add a computed column "IsEligibleToVote". The value of the column will be calculated based on the "Age" column.In the "IsEligibleToVote" column, write the following expression in the "(formula)".(case when [Age]>(18) then (1) else (0) end)Save the table. Now, insert the value using the following insert query.Insert into Test (Age) values(19)Output Posted By - Karan Gupta Posted On - Monday, July 26, 2021 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
(case when [Age]>(18) then (1) else (0) end)
Insert into Test (Age) values(19)
Query/Feedback