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

Re: C# Extended Stored Procedures

5 views
Skip to first unread message

Andrew J. Kelly

unread,
Jun 6, 2004, 8:02:38 AM6/6/04
to
To the best of my knowledge SQL 2000 does not support .net xp's.

--
Andrew J. Kelly SQL MVP


"Bill H" <anon...@discussions.microsoft.com> wrote in message
news:87B09D93-9FE1-4B78...@microsoft.com...
> I was trying to write an extended stored procedure for SQL Server 2000
using C#. I was hoping that there was a reference I could add for the ODS
naespace.
>
> Bill


Ryan Stonecipher [MSFT]

unread,
Jun 6, 2004, 2:49:46 PM6/6/04
to
See 322884 INF: Using Extended Stored Procedures or SP_OA Stored Procedures to Load
(http://support.microsoft.com/?id=322884) for more information.
 
Thanks
Ryan Stonecipher
SQL Server Storage Engine.
"Andrew J. Kelly" <sqlmvpn...@shadhawk.com> wrote in message news:#eWOv47S...@TK2MSFTNGP11.phx.gbl...

Vinodk

unread,
Jun 7, 2004, 4:19:27 AM6/7/04
to
You are correct. But you can always use CCW to create a wrapper and invoke
the assembly using the sp_OA* sp's. This is very much supported and it works
like gem :) ... Have tried the same ... Now you can use any CLR language to
create the asembly ie C#, VB .NET ...

--
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp


"Andrew J. Kelly" <sqlmvpn...@shadhawk.com> wrote in message

news:%23eWOv47...@TK2MSFTNGP11.phx.gbl...

Tibor Karaszi

unread,
Jun 7, 2004, 5:54:54 AM6/7/04
to
Hi Vinod!

I don't know what CCW is, but below KB article is rather clear the calling CLR code from SQL Server through an
xp or sp_OACreate is *not* supported...
http://support.microsoft.com/default.aspx?scid=kb;en-us;322884

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/


"Vinodk" <vinodk_sct@NO_SPAM_hotmail.com> wrote in message news:exxNOfG...@tk2msftngp13.phx.gbl...

Vinodk

unread,
Jun 7, 2004, 7:09:29 AM6/7/04
to
Tibor,

Well, this is documented that you cannot call a CLR code directly :). But
you can call it using a "com callable wrapper" (CCW) you can invoke a CLR
code indirectly. This is a dirty trick but it works for sure. Here is a code
snippet that Srinivas Sampath had posted on the same:
http://www32.brinkster.com/srisamp/sqlArticles/article_33.htm

You can also create a .NET component written as a extended stored proc and
called from SQL Server 2000. This article was by Kumar Gaurav Khanna (MVP,
.NET) written sometime back. This is even more interesting. Look at the
implementation at :
http://www.wintoolzone.com/showpage.aspx?url=dotnet.aspx?show=sourcecode.

Your comments are welcome ...

--
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com


"Tibor Karaszi" <tibor_please.n...@hotmail.nomail.com> wrote in
message news:eeWf7VHT...@TK2MSFTNGP11.phx.gbl...

Tibor Karaszi

unread,
Jun 7, 2004, 7:45:58 AM6/7/04
to
Vinod,

From the KB:

"This limitation for support pertains directly to the use of extended stored procedures and the use of OLE
Automation for any loading of the libraries that you must load to run in the SQL Server memory space."

In Proc COM objects will certainly be in-memory, right? Or does the wrapper handling make it an executable,
out-proc?

As for extended stored procedures, they will be in-proc, unless you use something like xp_cmdshell or similar
to spawn your own process

I have a feeling that the solutions you mentioned seems to work, but they are still in-process and hence not
supported and might/will cause problems under load etc. However, If the solutions are out-proc, then they very
well might work...


"Vinodk" <vinodk_sct@NO_SPAM_hotmail.com> wrote in message news:%23vCyO%23HTEH...@TK2MSFTNGP10.phx.gbl...

Vinodk

unread,
Jun 7, 2004, 8:28:13 AM6/7/04
to
Tibor,

The first solution using sp_OA* will be inproc and so is the case with using
xp's.

> In Proc COM objects will certainly be in-memory, right? Or does the
wrapper handling make it an executable,
> out-proc?

AFAIK, You are 100% correct here. The CCW is just a COM interface to calling
the .NET assembly. Hence the invocation is as normal COM component. It will
*not* work as out-proc.

> I have a feeling that the solutions you mentioned seems to work, but they
are still in-process and hence not
> supported and might/will cause problems under load etc.

You are correct. It is not *supported*. I see it is as, not supported by MS.
Doesnt say it will not work ... There are potential risks involved in using
the same :).

The extract from the KB article is "Microsoft *does not support* the use of
Microsoft Common Language Runtime (included with .NET Framework) for any COM
Callable Wrapper or Managed Extensions for C++ in either Microsoft SQL
Server 7.0 or Microsoft SQL Server 2000."

--
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com


"Tibor Karaszi" <tibor_please.n...@hotmail.nomail.com> wrote in

message news:%23YqMAUI...@TK2MSFTNGP10.phx.gbl...

0 new messages