我正在將SQL Server 2008遷移到2012年,並且遇到了爲CLR例程創建一些必要程序集的挑戰。該例程取決於stdole.dll
,但我無法創建此程序集。我的代碼如下:無法在SQL Server 2012中註冊stdole程序集
ALTER DATABASE main SET TRUSTWORTHY ON;
create assembly [stdole]
from
'C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\stdole.dll'
WITH PERMISSION_SET = unsafe
我收到以下錯誤:
Warning: The Microsoft .NET Framework assembly 'stdole, version=7.0.3300.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.' 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.
Msg 10332, Level 16, State 1, Line 3
Assembly "stdole" was built using version v1.0.3705 of the .NET Framework. SQL Server currently uses version v4.0.30319.
我目前使用具有系統管理員權限,所以我有UNSAFE ASSEMBLY
權限的帳戶登錄。
請幫忙!我一直在研究這個小時,但找不到任何有用的東西。
感謝
什麼是錯誤?我只看到一個警告。 – TomTom
@TomTom:第一行是警告,但是它下面的兩行是一個硬性錯誤。 –
您可能不應該從SQL Server調用Office Interop程序集!我會推薦一種替代方法(例如數據庫中的作業隊列表和一個執行此工作的.NET CLI應用程序 - 可能每隔幾分鐘由任務調度程序運行以檢查隊列) –