简体   繁体   English

SQL Server 2008 R2如何创建ASSEMBLY

[英]SQL Server 2008 R2 how to create ASSEMBLY

I am trying to run an assembly I have saved the project and the dll file in the mapped drive on my PC to the server: 我正在尝试运行一个程序集,已将项目和dll文件保存在PC上的映射驱动器中的服务器上:

USE <TEMP>
GO

CREATE ASSEMBLY [BooksMgr]
AUTHORIZATION [dbo]
FROM 'Z:\FY_2011-12\04 Individual\JohanZ\BooksMgr\BooksMgr\bin\Release\BooksMgr.dll' 
WITH PERMISSION_SET = SAFE
GO

and the error I am getting: 和我得到的错误:

CREATE ASSEMBLY failed because it could not open the physical file CREATE ASSEMBLY失败,因为它无法打开物理文件
"Z:\\FY_2011-12\\04 Individual\\JohanZ\\BooksMgr\\BooksMgr\\bin\\Release\\BooksMgr.dll":21 “ Z:\\ FY_2011-12 \\ 04单个\\ JohanZ \\ BooksMgr \\ BooksMgr \\ bin \\ Release \\ BooksMgr.dll”:21
(failed to retrieve text for this error. Reason: 15105). (由于该错误而无法检索文本。原因:15105)。

you may try looking at this MSDN Link 您可以尝试查看此MSDN链接

How to: Create and Run a SQL Server User-Defined Function by using Common Language Run-time Integration 如何:使用公共语言运行时集成来创建和运行SQL Server用户定义的函数

As as side not.. make sure that you have created that Assembly first before trying to reference it in the way you are doing in your current code..also make sure that assembly does not reference other assemblies otherwise you will need to create those assemblies first as well.. 顺便说一句..请确保您先尝试创建该程序集,然后再尝试以当前代码中的方式对其进行引用。.还请确保该程序集未引用其他程序集,否则您将需要创建这些程序集首先也是..

Make sure the assembly is created in the directory you are looking for in Z: prior to referencing as well 还要在引用之前,在您要在Z:中查找的目录中创建程序集

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM