SQL CLR集成的多线程处理
iaxk 2009-11-25 04:04:40 正在利用SQL CLR集成用C#写一个SQL Server的存贮过程. 在程序中,我需要使用多线程, 但只要我在程序中调用了Thread.Start(), 在执行这个存贮过程时, SQL Server就会报如下的错误:
A .NET Framework error occurred during execution of user-defined routine or aggregate "CalcReport":
System.Security.HostProtectionException: Attempted to perform an operation that was forbidden by the CLR host.
The protected resources (only available with full trust) were: All
The demanded resources were: Synchronization, ExternalThreading
System.Security.HostProtectionException:
............
另外,我这个Dll装载到SQL Server中用的安全性是SAFE
看了半天的MSDN, 网上也搜了很久, 都没有搜到解决办法. 望高手指教, 在此多谢!