How to create a C # assembly to load in SQL Server 2008

I was wondering if anyone would be able to provide me with recommendations or recommendations on creating a C # assembly that will be loaded into sqlserver and run in the database as new data arrives.

Background:
I have several years of Java experience and I created an algorithm to work with data obtained from an SQL query. Now my employer wants me to create it as a C # assembly, which is directly in the database, and analyze when the data arrives (or periodically) and sends warnings if they exceed a certain threshold.

I never encoded in C #, but I was told that it is very similar to Java. Learning C # is not my problem here, I think I can choose this from online resources. I had problems finding information about the assembly and its relations with the sqlserver server / if there should be something specific in the code for it to work.

I am browsing the Microsoft msdn library online to get an idea, and I think what I am looking for is this C# SQL CLR Database Project.

Is this what I am trying to accomplish? If so, does anyone have any hints / things to look for when working on this?

ps. Is there a way to directly handle tables? Instead of constantly querying the data, how do I do with Java? I'm not sure if this is possible, but I thought it could be, because the assembly is somehow directly related to the database.

+3
source share
2 answers

What you can do is use C # to create custom functions for sql server. In order for this function to start as new data is entered, you can write a trigger for the corresponding tables that call the function as part of the selection query on the tab of the inserted table .

+4
source

Check out this article in the Easy Talk section:

SQL Server 2005 CLR

, SQL CLR SQL Server.

+1

Source: https://habr.com/ru/post/1794029/


All Articles