calling a C# dll from a stored procedure or a sql server job

  • Hi,

     I have a email sending DLL which is created in C# and i want to be able to call the DLL in a sql server job or a stored procedure (i am running sql server 2000).

    any help will be greatly appreciated.

    regards,

    nuwan

     

  • you will not be able to do this SQL Server does not support calling C# managed dll's u will need to rewrite in C++ or Delphi or something similar


    Kindest Regards,

    bryan.oliver@quest.com

    quest.com

  • oh..k. thank you for the reply.

    but i have a question... I have a dll which was written in VB 6 and it calls from a sql server job and works fine (using vb script as the active script on the job).. so is it only .net languages dll's wouldn't work on sql server jobs?

  • I wonder if this is the case with SQL 2005, since it runs on managed code itself?

  • SQL 2005 should work fine but I have not had a chance to try it.


    Kindest Regards,

    bryan.oliver@quest.com

    quest.com

  • To clarify:

    In a DTS package, if you have a step that is an ActiveX task, you can call a DLL written in any language.

    But the ActiveX script is not running inside of the SQL Server, it running under DTSRUN.EXE

    What you cannot do is call a DLL from within a SQL Server object, such as a stored procedure or trigger, unless the DLL is written in C++ , Delphi or something similar.

    SQL = Scarcely Qualifies as a Language

  • As you have said that you got a VB6 dll working fine with SQL2K, you can create a similar VB6 dll and call the managed code written in C#. Then you will be able to indirectly call the C# dll. ( This is what I think it should work - but not tried myself )

    Check this link out where they talk abt calling a C# dll from VBScript.

    http://www.c-sharpcorner.com/Code/2002/Mar/CallingManagedCodeFromUnmanagedFB.asp

  • Thank you very much for your replies...

Viewing 8 posts - 1 through 7 (of 7 total)

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