【发布时间】:2010-11-14 10:26:13
【问题描述】:
我有一个 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.
除了我为每个程序编写一个“CREATE ASSEMBLY”命令之外,还有一种更简单的方法可以将所有 .Net 3.5 程序集放入 SQL 2005 CLR 中吗?是否有一些“最佳实践”方式来做到这一点?
【问题讨论】:
-
你会认为有人不厌其烦地为他们中的许多人制作了一个大的 T-SQL 脚本并将其发布在网上......但我找不到一个:(
-
来自文档:SQL Server 还在同一位置查找此程序集的任何依赖程序集并上传它们。
标签: .net sql-server clr sqlclr