我有一个 CLR 存储过程,它引用在 VS 2008 中创建的使用 Linq 的程序集。让我们将此程序集称为“MyLib”。
我似乎无法将“MyLib”放入我的 SQL 2005 数据库。我执行以下操作:
CREATE ASSEMBLY [MyLib]
FROM 'C:\MyLib\bin\Release\MyLib.dll'
WITH PERMISSION_SET = UNSAFE
GO
但我得到了错误:
Assembly 'MyLib' references assembly 'system.core, version=3.5.0.0,
culture=neutral, publickeytoken=b77a5c561934e089.', which is not present
in the current database. SQL Server attempted to locate and automatically
load the referenced assembly from the same location where referring assembly
came from, but that operation has failed (reason: 2(error not found)). Please
load the referenced assembly into the current database and retry your request.
有没有一种更简单的方法可以将所有 .Net 3.5 程序集放入 SQL 2005 CLR,除了我为每个程序写一个“CREATE ASSEMBLY”命令?是否有一些“最佳实践”的方式来做到这一点?