I would like to store my calculations within a table in SQL and then use them in a stored procedure. Is this possible? The calculation table would consist of several fields; CalculationID, Name, and Calculation. Data might look something like the following:
CalculationID: 1
Name: AVAILABILITY
Calculation: ((DATA.AVAIL_EXPECTED * APPLICATIONS.REGION_COUNT) -(DATA.OUTAGE_MINUTES * DATA.AFFECTED_REGIONS))/(DATA.AVAIL_EXPECTED * APPLICATIONS.REGION_COUNT)
The reason that I ask is that my stored procedures are quite complex and the calculations seem to change every day. Remembering or even finding every occurence of a reference to a particular calculation is somewhat tedious and problematic.
Any help would be greatly appreciated.
Jeff
CalculationID: 1
Name: AVAILABILITY
Calculation: ((DATA.AVAIL_EXPECTED * APPLICATIONS.REGION_COUNT) -(DATA.OUTAGE_MINUTES * DATA.AFFECTED_REGIONS))/(DATA.AVAIL_EXPECTED * APPLICATIONS.REGION_COUNT)
The reason that I ask is that my stored procedures are quite complex and the calculations seem to change every day. Remembering or even finding every occurence of a reference to a particular calculation is somewhat tedious and problematic.
Any help would be greatly appreciated.
Jeff