External libraries are loaded by the server the first time a UDF that requires it is invoked. A loaded library remains loaded by the server for the life of the server once it has been loaded after first being needed. It is not loaded when a CREATE FUNCTION call is made, nor is it automatically unloaded when a DROP FUNCTION call is made.
If the library version must be updated, the dbo.sa_external_library_unload procedure forces the library to be unloaded without restarting the server. The call to unload the external library will only be successful if the library in question is not currently in use. The procedure takes one optional parameter, a long varchar, that specifies the name of the library to be unloaded. If no parameter is specified, all external libraries not in use are unloaded. The syntax for unloading an external function library.
call sa_external_library_unload('library.dll')
If a registered function uses a complete path, for example '/abc/def/library.dll', unregister the function or the library will not be unloaded.
call sa_external_library_unload('/abc/def/library.dll')