简体   繁体   English

注册SQL CLR存储过程中使用的程序集

[英]Registering Assemblies used In SQL CLR Stored Procedure

I have been messing around with writing some stored procedures in .NET code with SQL CLR Integration. 我一直在乱用.NET CLR集成在.NET代码中编写一些存储过程。 In the stored procedure, I am calling a third-party dll. 在存储过程中,我正在调用第三方DLL。 When I try to create the assembly in SQL Server containing my custom stored proc, it complains that the third-party dll is not registered with the database. 当我尝试在包含我的自定义存储过程的SQL Server中创建程序集时,它会抱怨第三方dll未在数据库中注册。

Is there some way I can call the dll without registering it in SQL Server? 有没有办法在没有在SQL Server中注册的情况下调用dll?

No, you can't use an assembly that isn't in the Approved Assembly list , or that isn't registered in the database. 不可以,您不能使用不在“ 已批准的程序集”列表中的程序集,也不能使用未在数据库中注册的程序集。 You can't even load it into the GAC to access it, it has to explicitly be added to SQL Server using CREATE ASSEMBLY. 您甚至无法将其加载到GAC中以访问它,必须使用CREATE ASSEMBLY将其显式添加到SQL Server。 Why don't you want to load the assembly into the database? 为什么不想将程序集加载到数据库中? What is it doing that you need in SQL? 你在SQL中需要做什么? I ask because there may be a different solution to your problem that is a better fit. 我问,因为可能有一个不同的解决方案,你的问题更合适。

The third party assembly must be pre-deployed to the server. 必须将第三方程序集预先部署到服务器。 Look at this link for instructions on deploying the assembly to the server. 请查看此链接以获取有关将程序​​集部署到服务器的说明。

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

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