Suposse I have an UDF in SQL Server 2008:
Create function dbo.ReadXml (@xmlMatrix xml) returns table
as
return
( select
--SOME C++ CODE
)
go
- Is it possible to add a c++ code or call a c++ function inside the UDF?
Onyl if this C++ function was compiled and installed as an extended stored procedure.
But extended stored procedures are deprecated and will be removed soon.
So your only reliable option is to write a CLR function. It can be a C# CLR function that calls an external C++ dll, or it might be a managed C++ CLR function that would contain your code directly.
SAFE) because you don't try to load something from outside.