Groups | Blog | Home
all groups > sql server (microsoft) > july 2006 >

sql server (microsoft) : Extended Stored Procedure with direct access to SQL Server


atlan NO[at]SPAM tournedos.de
7/28/2006 10:06:33 AM
I am an experienced developer and would like to write an extended
stored procedure (ESP) in C/C++. I know that this technology is not
supported beyond SQL Server 2005 but I still need a solution that will
work on 2000 and 2005.

This ESP needs to access a table on the SQL Server that is it running
on. I would like to do this without the need to establish a connection
via ODBC.

Is there some object within the ESP that I can use to directly contact
the SQL Server I am running on - in a way that I can directly execute
SQL statements?

Could you point me to some sourcecode / example that is achieving that.

Or is direct access only supported by the new 2005 CLR extensions?


Thank you for your help,
Holger
Mike C#
7/30/2006 1:17:57 AM
You can connect back to your SQL Server in an XP using db-lib. It's ugly,
it's slow, but it'll get the job done. There are some XP db-lib examples
that come with SQL 2000, at least one of them contains an example of
connecting back to execute SQL statements against a database. If you don't
have them on your hard drive (in the \80\Tools\DevTools\Samples directory)
you can download them from the MS website. I would highly recommend for SQL
2005 that you not use the old-style XP's.

[quoted text, click to view]

AddThis Social Bookmark Button