SSIS - CLR Sproc 的 OleDBCommand 问题
我正在编写一个 SSIS 包来将数据从临时环境移动到我们的生产服务器。
我有一个 CLR 存储过程 esp_ProcessStagingXML,它有 4 个参数,其中 2 个输出参数。
我试图在 SSIS 包的数据流中的每个项目中调用此 CLR 存储过程一次。
我已经创建了 OLEDBCommand,具有以下 SqlCommand 属性:
exec [esp_ProcessStagingXML] ?, ?, ? output, ? output
但是,无论我尝试做什么,我都会收到以下错误:
Error at Move Documents to XXX [Insert Into XXX[16]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occured. Error code: 0x80004005.
An OLE DB record is availabl. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005
Description: "Syntax error, permission violation, or other nonspecific error"..
我尝试在 sa 帐户下运行此命令,以验证不涉及安全问题。由于 htis,我无法将列映射到参数,并且每次单击“刷新”时都会失败。我对显式选择语句或不是 CLR 存储过程的存储过程没有任何问题。有遇到/找到解决方案吗?
USE [XXXX]
GO
/****** Object: StoredProcedure [dbo].[esp_ProcessStagingXML] Script Date: 02/15/2011 15:31:35 ******/
ALTER PROCEDURE [dbo].[esp_ProcessStagingXML]
@param1 [nvarchar](max),
@param2 [bigint],
@param3 [bit] OUTPUT,
@param4[nvarchar](max) OUTPUT
WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [PullFromStaging].[StoredProcedures].[esp_ProcessStagingXML]
GO
这是在 Microsoft Sql Server 2008 R2 上。
I'm writing an SSIS package to move data from a staging environment to our production server.
I have a CLR stored procedure esp_ProcessStagingXML which has 4 parameters, 2 of them output parameters..
I'm trying to call this CLR sproc once per item in the dataflow of my SSIS package.
I've created the OLEDBCommand, with the following SqlCommand property:
exec [esp_ProcessStagingXML] ?, ?, ? output, ? output
however I'm getting the following error no matter what I've tried to do:
Error at Move Documents to XXX [Insert Into XXX[16]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occured. Error code: 0x80004005.
An OLE DB record is availabl. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005
Description: "Syntax error, permission violation, or other nonspecific error"..
I've tried running this under the sa account to verify there are no security issues involved. I am unable to map columns to parameters because of htis, and it fails every time I click Refresh. I don't have any issues w/ explicit select statents or sprocs which are not CLR sprocs. Has encountered / found solutions to this?
USE [XXXX]
GO
/****** Object: StoredProcedure [dbo].[esp_ProcessStagingXML] Script Date: 02/15/2011 15:31:35 ******/
ALTER PROCEDURE [dbo].[esp_ProcessStagingXML]
@param1 [nvarchar](max),
@param2 [bigint],
@param3 [bit] OUTPUT,
@param4[nvarchar](max) OUTPUT
WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [PullFromStaging].[StoredProcedures].[esp_ProcessStagingXML]
GO
This is on Microsoft Sql Server 2008 R2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过将此存储过程包装在另一个存储过程(称为 CLR 存储过程)中解决了这个问题。
哈克但似乎有效。
I resolved this by wrapping this sproc in another sproc, which called the CLR sproc.
hacky but seems to work.
查看CLR 集成代码访问安全性。
我怀疑当您在 SQL Server 中创建程序集时,您没有授予足够的权限集。
Take a look at CLR Integration Code Access Security.
I suspect that when you created the Assembly in SQL Server you did not grant a sufficient PERMISSION SET.