Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Programming / CLR / July 2008

Tip: Looking for answers? Try searching our database.

CLR proc to access a COM object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dan Holmes - 07 Jul 2008 16:30 GMT
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
Thorsten Kansy - 27 Jul 2008 23:13 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.