MS SQL Server check existence of registered Assembly
In a database I generally use a XML based version of a split function. Later on with some research I created a Assembly CLR version of the split function.
In a database update process (patch) I remove all user functions, patch the database and then create the user functions again. Due the patch process it will restore the XML version of the split function again.
I checked MSDN so far, but I wasn’t able to find any hint for:
How can I check if a DLL is registered as an assembly inside the database?
In Management Studio I can open the database -> Program ability -> Assembly and can see the DLL, if it is registered. But I want to do this programmatically and use the CLR version on CREATE FUNCTION if the DLL is available, else I want to use the XML version to make sure that the split function is available in any case.
Anyone know if this is possible?
One Solution collect form web for “MS SQL Server check existence of registered Assembly”
Try this. There are more
sys.%assembly% views, check them out, too.
select * from sys.assembly_files f full outer join sys.assemblies a on f.assembly_id=a.assembly_id full outer join sys.assembly_modules m on a.assembly_id=m.assembly_id