I need to access a COM object (C++) from a stored proc. the interface is too complicated for SQL so i thought i would
write a .net proc as a wrapper for the COM object.
I don't see how to add a reference to the COM object. When i pick add reference the only thing i get is the SQL server
tab and the projects reference. Is this not possible?
I suppose i could write another assembly that would access the COM object and have the .net store proc use it but that
seems unnecessary.
thanks
dan
Hi Dan,
as far as I know you can only add references to a few assemblies and other
sql-clr-assemblies. But SQL Server stores all files in a database table
(instead of a directory). To this table you can put extra assemblies (files
in general) and load them dynamically using reflection.
Not easy, but ...
Regs
Thorsten Kansy
>I need to access a COM object (C++) from a stored proc. the interface is
>too complicated for SQL so i thought i would write a .net proc as a wrapper
[quoted text clipped - 9 lines]
> thanks
> dan
Bob Beauchemin - 28 Jul 2008 00:15 GMT
Or you can use an ordinary Class Library project rather than using a
Database project. Then you can add any assembly you want, but you must write
the (trivial) create assembly and create function DDL yourself.
Using any libraries that use COM means that the assembly must be cataloged
as unsafe.
Cheers,
Bob Beauchemin
SQLskills
> Hi Dan,
>
[quoted text clipped - 22 lines]
>> thanks
>> dan