我编写了一个用户定义函数,它获取UtcTimeStamp和windowstimezoneid作为参数,并返回TimeZone的TimeStamp.
但如果我想在一个简单的选择中执行它我得到以下错误:
A .NET Framework error occurred during execution of user-defined routine or aggregate "ToLocalTime":
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: MayLeakOnAbort
System.Security.HostProtectionException:
bei TimeFunctions.ToLocalTime(DateTime UtcTimestamp, String WindowsTimeZoneId)
Run Code Online (Sandbox Code Playgroud)
我执行select as sa.我将clr设置为1.我使用SQL Server 2008 R2(10.50.1600).
有谁知道我必须设置什么才能使这个工作或我可能做错了什么?
| 归档时间: |
|
| 查看次数: |
7843 次 |
| 最近记录: |