Search code examples
c++sql-servervisual-studiosqlclruser-defined-types

How should I use SQL Server CLR to employ UDT compiled by C++/C


I got a question on how should I C++/C to deploy SQL Server User Defined Type to hold complex data structure.

I am using VS2017 and SQL Server 2012.

I'm kind of knowing how to do it using C#, while I prefer C++/C much more and it provide me faster and more direct way of operating and realize functions and properties.

So if anyone could help me on applying of that?


Solution

  • First of all - the C++ assembly has to be compiled with /clr:pure. If that is the case then there is no difference between a C# assembly and a C++.

    Oh, one thing a C++ assembly compiled with /clr:pure is not callable in SQL server 2005 for one reason or another. However in SQL server 2008 and up it should work fine.

    Hope this helps!