Calling a DLL written in C directly from the database

  • Hello,

    I would like to know if there is a way to call methods in an existing dll directly from the sql code in SQL Server.

    In other words: I have a dll written in c. Is there a way to call it directly from the sql code?

    Thanks,

    Marcelo

  • In Books On Line,look for sp_oacreate and all other method starting with "sp_oa"

    Hope that helps.


    paul

  • Thanks, Paul

    Found what I was looking for =c]

  • Just to add. Since this DLL is written in C, you might want to consider adding it as your own extended procedure with sp_addextendedproc

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Hmm... Interesting, Frank.

     

    I actually just made a stored procedure and called the OA methods to create the object and call the methods in the dll...

    But how would I create an extended stored procedure for this? Have you got any code you can share, or a step by step tutorial?

    Thanks for the reply

  • When you search BOL for "extended stored procedures" you'll find a basic example. In addition, this might be interesting. http://www.codeproject.com/database/xp_md5.asp

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply