Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

accessing an activex server from SQLCLR

6 views
Skip to first unread message

Dan Holmes

unread,
Dec 9, 2008, 9:30:51 AM12/9/08
to

I need to create an out-of-process activex server and i need to be able to access its methods from SQL Server.

I have an existing COM dll that i need to access from SQL Server. Because the DLL is unsafe and could kill the server
it is better for it to not be in the SS process space. (I know because i have used this method and i have crashed SS).

What i thought i would do is create an activex server to host that COM object and access the COM object through the
activex server.

A .net solution would be great but remoting isn't available in SQLCLR.

Has anyone tried this? Is it possible? I guess if worse comes to worse i could use the sp_OA* procs to get to the COM exe.

dan

Bob Beauchemin

unread,
Dec 9, 2008, 12:55:33 PM12/9/08
to

Remoting is unsafe, but web services can be used in external_access
assemblies. Be aware of the fact that if you use "add web reference" to
create your web service client, you must also pregenerate the proxy assembly
(ngen.exe or project properties\build\generate serialization assembly=on in
VS projects) and catalog it (create assembly) as SQL Server prohibits
dynamically generated code. The serizalization assembly can be cataloged as
safe.

If you're going to call out-of-proc, ensure that your design takes the fact
that the service may be down (and the call may timeout) into consideration.
You wouldn't want to call this inside of a trigger, for example, but inside,
wrap it inside a service broker activation proc.

Hope this helps,
Bob Beauchemin
SQLskills

"Dan Holmes" <dan.h...@routematch.com> wrote in message
news:%23rx19sg...@TK2MSFTNGP04.phx.gbl...

Dan Holmes

unread,
Dec 9, 2008, 4:27:23 PM12/9/08
to

can i use enterprise services (COM+)?

Bob Beauchemin

unread,
Dec 9, 2008, 7:02:05 PM12/9/08
to

Enterprise Services (System.Enterprise.Services.dll) is unsafe/untested but
its successor, System.Transactions.dll is safe. AFAIK System.Transactions
provides a "backward compatibility" mode for System.Enterprise.Services.

Cheers,
Bob Beauchemin
SQLskills


"Dan Holmes" <dan.h...@routematch.com> wrote in message

news:ekVtsVkW...@TK2MSFTNGP05.phx.gbl...

0 new messages