write formula for column in database

Last Reply on Sep 06, 2012 06:01 AM By RkHirpara

Posted on Sep 06, 2012 05:51 AM

hi 

this is my table

Id

Price1

meter

price

1

1,000,000

250

 

 

i want when users insert data in  Price1 and ,meter  columns

 in database automatically in Price column insert this formula

 

Price1*Meter

how i can write storeprocedure for this?

best regards

 

 

 

Posted on Sep 06, 2012 06:01 AM

I think you needs to try like this.

 

insert into table
(
	price1,
	meter,
	price	
)
values
(
	@price1,
	@meter,
	@price1 * @meter
)

This is just logic please do required changes.