Re: Loading an external DLL
From: Carsten Ingemansson (carsten_at_trivector.se)
Date: 10/07/04
- Next message: Savas Ates: "trigger quiz"
- Previous message: dgk: "Replace a table automatically?"
- In reply to: Carsten Ingemansson: "Loading an external DLL"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 7 Oct 2004 14:49:40 +0200
To answer my own question...
Create a DLL
Export a function - "MyFunc"
Put the DLL i SQL Servers BINN directory
Execute the following in Query analyzer to register the function i SQL
Server
use master
go
sp_addextendedproc 'MyFunc', 'MyDLL.dll'
go
Call the function from Query Analyzer or from a trigger
exec master..MyFunc 'Param1', 'Param2', ...
To unregister the function, execute the following
use master
go
sp_dropextendedproc 'MyFunc'
go
The following command could be useful if SQL Server doesn't release the DLL.
If SQL Server still doesn't release the DLL you have to restart SQL Server.
use master
go
DBCC MyDLL(Free)
go
Carsten
"Carsten Ingemansson" <carsten@trivector.se> skrev i meddelandet
news:OgDYpCiqEHA.4008@TK2MSFTNGP14.phx.gbl...
> Is it possible to load, run a function from and then unload an external
DLL
> from within a trigger. If it is - how do I do it?
>
> Carsten
>
>
- Next message: Savas Ates: "trigger quiz"
- Previous message: dgk: "Replace a table automatically?"
- In reply to: Carsten Ingemansson: "Loading an external DLL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|