Thông tin được cung cấp từ các câu trả lời khác đã dẫn tôi đến giải pháp. Dưới đây là các bước tôi đã đưa ra để tham khảo trong tương lai:
CREATE ASSEMBLY [System.DirectoryServices]
FROM 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.DirectoryServices.dll'
WITH PERMISSION_SET = UNSAFE
GO
Lần đầu tiên tôi chạy báo cáo kết quả trên, chúng tôi đã nhận lỗi sau:
CREATE ASSEMBLY for assembly 'System.DirectoryServices' failed because assembly 'System.DirectoryServices' is not authorized for PERMISSION_SET = UNSAFE. The assembly is authorized when either of the following is true: the database owner (DBO) has UNSAFE ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission.
Để có được câu lệnh CREATE HỘI để thực hiện mà không có lỗi Tôi đã phải lần lượt TRUSTWORTHY ON như sau:
ALTER DATABASE DatabaseName SET TRUSTWORTHY ON
GO
Khi TRUSTWORTHY được bật ON, lệnh được thực hiện không có lỗi nhưng nó đã trình bày cảnh báo âm thanh đáng sợ này:
Warning: The Microsoft .NET Framework assembly 'system.directoryservices, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
Với hệ thống.DirectoryServices được đăng ký đúng cách trong SQL Server Tôi bây giờ có thể triển khai/đăng ký lắp ráp SQL CLR tùy chỉnh phụ thuộc mà không có bất kỳ vấn đề nào.
Nguồn
2010-06-02 18:51:30