c# - Should I be using EF6 from a SQL CLR Function -


I have been hired to take some complex calculation code (C #) and research on going into the CLR function on SQL Server.

I have the problem that the calculation uses the data layer which uses EF6. Obviously I have to remove a small part of the existing code for the CLR function (SAR), but I still have to fulfill all the dependencies.

My question is how can I do this [which comes later :)] so should I will do this? Either way it is wrong to fill the entire EF in the database so that I am using it to calculate - it seems very bloated.

Opinion, suggestions, please consider?

Thanks

Unless pressing lot To keep the code-base in sync between the application layer and this SQLLLR function, I would say:

No, it does not seem like, if that is the case, it is useful to do this. You need some data points and using a simple SqlConnection for those simple string context connection = true; is very easy to use -process connection).

And, seeing that the performance is a concern (as it should be anyway, but still), this is the reason to go down to start this SQLCLR path, Manufacturer feels layers and layers of code that allow easy-to-use abstract layer, which is the unit framework.

Besides, why are you taking this function from within the function rather than passing it to the function? Are those values ​​passed which require additional look based on their special value?

  1. Scaler SQLLL function has been marked as IsDeterministic = true as . The input output in the SqlFunction attribute is cached and mapped so that they can be seen-up (in the context of additional rows in the same query) and the function is reused instead of being run again, and

  2. Scalar SQLCLR function is marked as IsDeterministic = true , and not marked DataAccess = DataAccessKind.Read SqlFunction attribute is acceptable in parallel schemes. If isDeterministic is not true or DataAccess (or even SystemDataAccess If marked as Read , they will function as regular T-SQL functions, so that they can prevent any query from receiving a parallel execution plan. Uses them.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -