What are computed Columns?

 Posted by Ddd on 2/4/2011 | Category: Sql Server Interview questions | Views: 3731 | Points: 40

Computed columns are the columns that can be used to store the calculated
results based upon some other columns of the table

create table emptable
(eno int primary key,
ename varchar(10),
basic float,
hra float,
pf float,
gross as basic+hra+pf)

--gross is the computed column.
insert emptable values(100,'king',5000.77,500,200)
select * from emptable


eno ename basic hra pf gross

100 king 5000.77 500 200 5700.77

--we cannot insert or update in a computed column

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response