Triggering F# function from SQL
-
Monday, April 02, 2012 1:51 PM
Hello Forum,
I have an F# program that reads SQL tables, computes some value and puts it back into a table. Then a JavaScript web-application connects to the SQL server, shows graphically the computed value, shows the tables and allows their modification.
What I need now is dynamicity meaning when the user via the web-application modifies the SQL tables, I need to trigger the F# function to recompute the corresponding table.
I was wondering if I could
- trigger F# from MS SQL Server
- trigger F# from SQL from any database in a generic way
- "compile" or "reflect" the F# function into an SQL stored procedure in MS SQL Server
- do so in a generic way with any database
All Replies
-
Monday, April 02, 2012 4:07 PM
You can use SQLCLR objects written in F# smthng similar explained for example here:
http://www.nielsberglund.com/clr/using-fsharp-in-sqlclr/
Also you could take a look at new F# 3.0 feature called Type Providers:
http://msdn.microsoft.com/en-us/library/hh156509(v=VS.110).aspx
Petr
-
Tuesday, April 03, 2012 8:17 AM
SQLCLR allows running F# in MS SQL Server which should do the trick.
I am not sure however how F# Type Providers could solve my problem though. Could you be more specific ?
Also, any hints on how to solve the issue if I need any other database than MS SQL ?

