July 11, 2006 at 2:49 pm
Hi I'm looking for an efficient way to substitute parameter values into a varchar containing a formula. For example:
@price=10
@vat=0.1
I need a way to go from that formula to '10 * 0.1' so that I can evaluate it using exec('select '+@formula)
Any ideas?
July 11, 2006 at 3:02 pm
Because the formula will be passed as a parameter, since it will be stored in a field in a table and different formulas will be applied to different situations.
July 11, 2006 at 3:32 pm
Check out sp_executesql in BOL.
_____________
Code for TallyGenerator
July 11, 2006 at 3:43 pm
Thx
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply