Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

store value based on two columns

Status
Not open for further replies.

MartDawg

Programmer
Jan 14, 2004
33
US
I have a table

column1...column2.....column3

column1 is an int

column2 is an int

I want to store column1/column2 in column3 and have it update each time column(1 or 2) updates.

What is the best way to do this? I was thinking a trigger and a stored proc? Is there any way to store that info without a trigger or stored proc?

 
It's a bit unusual to store a value calculated from two other fields. Normal db practice would be to calculate when you need it, rather than store redundant information. However if you really need to do this then a Trigger and an update query would do it.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top