Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Calling a .Net dll from a stored procedure

Author  Topic 

rosa_orozco
Starting Member

2 Posts

Posted - 2003-09-22 : 11:31:45
Does any know how to create an instance and executing a .Net dll class from a stored procedure. I need to be able to schedule a .Net class to run every 15 minutes. This dll will call a Web Service and post some data.

Thank you very much for your help!!!


Rosa

SamC
White Water Yakist

3467 Posts

Posted - 2003-09-22 : 12:01:43
I'd be interested in this myself. Let me know if you get an answer.

Sam
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2003-09-22 : 12:44:32
Wrap up the DLL into an EXE and call it using xp_cmdshell.

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-09-22 : 13:17:04
How would you call it from a DTS VB proc?

Sam
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-09-22 : 13:35:24
Sam, what is a DTS VB proc?

Rosa, why do you need to this inside SQL Server? You could still use SQL Server's scheduler without using a stored procedure.

Tara
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2003-09-22 : 13:41:38
Sam, I've never used DTS, but this might help ya:

http://216.239.41.104/search?q=cache:bXiM8BSE0IoJ:www.devcity.net/forums/topic.asp%3Ftid%3D2918+call+.net+dll+from+vb6&hl=en&ie=UTF-8

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-09-22 : 14:15:28
Hi Tara,

My bad - I was using slang to refer to the use of Visual Basic / active scripting routines and executing them under DTS. It's a pretty good environment to schedule a VB job to run at regular intervals.

Sam
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-09-22 : 14:44:34
It really isn't necessary to involve DTS if you just need to call an exe, or anything that can be run from a command window. DTS introduces a lot of overhead and should be avoided.

Tara
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-09-22 : 20:55:45
quote:

DTS introduces a lot of overhead and should be avoided



You're big into the blanket statements today Tara

The answer to the original question though is COM interop. You can build a COM dll wrapper around your .NET dll and call the COM object using sp_oacreate.

Take a look in the .NET SDK docs for com interop.


Damian
Go to Top of Page
   

- Advertisement -