Hi All,
I need to perform some mathematical operations in an application. i want suggestions that implementing at which part will be performance wise more productive.
Like i need get data from 4 tables in db. And after that on retrieved data, numeric, multiplications & divisions will take place.
My questions is implementing these calculations in a stored procedure, or in code behind in grid view row bound event. Which will have more performance?
Ex. calculation in db:
SELECT CAST(ROUND((
((CAST(25 as float)/ CAST(100 as float)) * CAST(87.25 AS FLOAT)) +
((CAST(25 as float)/ CAST(100 as float)) * CAST(68.04 AS FLOAT)) +
((CAST(25 as float)/ CAST(100 as float)) * CAST(70.37 AS FLOAT)) +
((CAST(25 as float)/ CAST(100 as float)) * CAST(72.00 AS FLOAT))
), 2) AS NUMERIC(8,2))
What if the db has lot more data. And i need to use while loop in db for the calculations. Is that okay for performance wise.