c# - Calling UDFs In Other Languages From SQL Server -


currently, trying find out if there way write f# or c# code in visual studio, import udfs sql server, , call them within sql server. know possible write functions in f# can access/query database within visual studio , return results in visual studio. however, unsure if possible to, say, write function in f# or c# , have trigger execute function in sql server database each time table updated. appreciated.

it is.

they're called clr udfs (common language runtime, user defined functions).

the basic steps involve:

  1. create class library in lang of choice (most examples seem c#, that's not requirement), , implement function sqlfunction decorator.

  2. compile assembly, , import sql server

  3. install each sql function assembly

lots of documentation around once know they're called: https://msdn.microsoft.com/en-gb/library/ms131077


Comments