매개 변수로 UtcTimeStamp 및 windowstimezoneid를 가져오고 TimeZone의 TimeStamp를 반환하는 사용자 정의 함수를 작성했습니다.SQL Server에서 사용자 정의 함수를 실행할 때 System.Security.HostProtectionException
그러나 나는 다음과 같은 오류 얻을 선택 간단한 그것을 실행하려면 :
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)
내가 SA으로 선택을 실행합니다. clr을 1로 설정했습니다. SQL Server 2008 R2 (10.50.1600)를 사용합니다.
누구나 내가이 일을하거나 내가 잘못했을 수있는 일을 설정해야한다는 것을 알고 있습니까?
처음에는 신뢰할 수있는 설정을하고 데이터베이스 소유자를 sa로 변경했으나 안전하지 않은 상태로 작동합니다. – mabstrei
@gbn 어셈블리를 만들고 거기에 Unsafe 권한도 부여했지만 여전히 오류가 발생합니다. – Rahul