I\'m calculating linear regressions based on a data set. I do not know the regression model or number of parameters at compile-time.
I\'m storing the regression equa
In Sql Server, something like this Select 2+2 would return 4. So, you could have a stored procedure that reads the string out of the database and then builds another dynamic string let's call it (@SQLString) and run that query.
For example in this case the formula could be x + 2, then you build up a dynamic string based on that, and then call sp_executesql:
EXEC sp_executesql @SQLString
However, you should read this article on Dynamic SQL before you go down that road.
I believe what you are doing it just fine.