Friday, March 30, 2012

running a vb.net dll from sql server

We have a new application were building which includes a module to preform
overnight processing.
Originally the idea was to schedule a job on the server to run for each
database that needs the processing completed.
Whats the best way to do this?
we are using vs 2003, ms slq server 2000
1) All the code to execute is in a vb.net dll
2) needs to be run against one or more databases
suggestions?There are a number of ways to accomplish this. One method is to wrap your
DLL in a command-line EXE that takes arguments for server, database, etc.
and then schedule a SQL Agent job with a CmdExec step for each database.
Hope this helps.
Dan Guzman
SQL Server MVP
"Claude Hebert" <chebert@.rvmags.com> wrote in message
news:ug8QC2$JGHA.2392@.TK2MSFTNGP09.phx.gbl...
> We have a new application were building which includes a module to preform
> overnight processing.
> Originally the idea was to schedule a job on the server to run for each
> database that needs the processing completed.
> Whats the best way to do this?
> we are using vs 2003, ms slq server 2000
> 1) All the code to execute is in a vb.net dll
> 2) needs to be run against one or more databases
> suggestions?
>|||....my first thought is that the VB.Net app logs in and does its thing.
In the old days, I'd write my dll in VB6 and use an ActiveX DTS or TSQL
sp_OACreate.
HTH
JeffP...
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:uHSQD$$JGHA.3276@.TK2MSFTNGP09.phx.gbl...
> There are a number of ways to accomplish this. One method is to wrap your
> DLL in a command-line EXE that takes arguments for server, database, etc.
> and then schedule a SQL Agent job with a CmdExec step for each database.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Claude Hebert" <chebert@.rvmags.com> wrote in message
> news:ug8QC2$JGHA.2392@.TK2MSFTNGP09.phx.gbl...
>|||What about using rundll32.exe?
--
Andrey Odegov
avodeGOV@.yandex.ru
(remove GOV to respond)|||the best method is to do with
SP_OACreate procedure
steps are :
1. if u r using vb.net dll then make sure the value of Register for COM
Interop value TRUE in Project properties ->Configuration Properties
->Build.
2. add strongname with ur project by sn -k utility.
3. publish ur dll in GAC
4. put ur dll and tlb in system32
5. register ur tlb using regtlibv12 tools
6. in sql server stored procedure create a object of tha dll by using
sp_OACreate.
7.use sp_OAMethod to access methods of that Dll.
8. use sp_OAGetProperty,sp_OASetProperty for getting or setting values.
9. use sp_OADestroy to destroy the object at last.
this is really simple.
if u need example for this then mail me personally at
kissvineet@.yahoo.com

No comments:

Post a Comment