现在,如果我更新程序集(例如添加新功能),sql Server将不会遵循更新的dll,直到我删除程序集:
DROP ASSEMBLY CLRFunctions Msg 6590,Level 16,State 1,Line 1 DROP ASSEMBLY Failed because 'CLRFunctions' is referenced by object 'normalizeString'.
DROP FUNCTION normalizeString DROP FUNCTION RemoveDiacritics DROP FUNCTION RemoveCombiningDiacritics DROP FUNCTION Combineligatures .... DROP FUNCTION Pseudolocalizearabic
然后我可以放弃大会:
DROP ASSEMBLY CLRFunctions
现在我必须“创建”程序集:
CREATE ASSEMBLY CLRFunctions FROM 'c:\foos\CLRFunctions.dll';
我宁愿更新程序集,让sql Server开始使用它.
更新:我随机尝试DBCC FREEPROCCACHE强制“重新编译”,但sql Server仍然使用旧代码.
更新:我删除了程序集DLL CLRFunctions.dll,sql Server仍然能够运行代码(没有代码应该是不可能的).
解决方法
If the FROM clause is specified,ALTER ASSEMBLY updates the assembly
with respect to the latest copies of the modules provided. Because
there might be CLR functions,stored procedures,triggers,data types,
and user-defined aggregate functions in the instance of sql Server
that are already defined against the assembly,the ALTER ASSEMBLY
statement rebinds them to the latest implementation of the assembly.
To accomplish this rebinding,the methods that map to CLR functions,
stored procedures,and triggers must still exist in the modified
assembly with the same signatures. The classes that implement CLR
user-defined types and user-defined aggregate functions must still
satisfy the requirements for being a user-defined type or aggregate.
ALTER ASSEMBLY Complexnumber FROM 'C:\Program Files\Microsoft sql Server\90\Tools\Samples\1033\Engine\Programmability\CLR\UserDefinedDataType\CS\Complexnumber\obj\Debug\Complexnumber.dll'
原文地址:https://www.jb51.cc/mssql/81336.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。