【发布时间】:2015-10-25 09:26:14
【问题描述】:
我们有一个存储过程来创建一个新的 SSIS 执行并启动它:
Declare @execution_id bigint
EXEC [SSISDB].[catalog].[create_execution]
@package_name=N'00 XXXX.dtsx',
@execution_id=@execution_id OUTPUT,
@folder_name=N'XX',
@project_name=N'XXX';
EXEC [SSISDB].[catalog].[start_execution] @execution_id;
当我们调用这个使用 SQL Server Management Studio 登录的存储过程时,它可以完美运行。但是,当我们从 BizTalk(作为 BTS 服务帐户用户)中执行此存储过程时,我们会收到此错误:
System.Data.SqlClient.SqlException (0x80131904):“-”附近的语法不正确。
“-”附近的语法不正确。
'-' 附近的语法不正确。服务器堆栈跟踪:
在 System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult 结果)
在 System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult 结果)
在 System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult 结果)
在 System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult 结果)在 [0] 处重新抛出异常:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 类型)
在 System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult 结果)
在 Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult 结果)
我们使用的从 BTS 到 MS SQL 的架构:
<?xml version="1.0" encoding="utf-16"?>
<schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo" version="1.0" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<fileNameHint xmlns="http://schemas.microsoft.com/servicemodel/adapters/metadata/xsd">TypedProcedure.dbo</fileNameHint>
</appinfo>
</annotation>
<element name="StartBifImport">
<annotation>
<documentation>
<doc:action xmlns:doc="http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation">TypedProcedure/dbo/StartBifImport</doc:action>
</documentation>
</annotation>
<complexType>
<sequence />
</complexType>
</element>
</schema>
BTS 服务帐户在存储过程所在的数据库上具有 db_owner 角色,我们已明确授予它对 SSIS 文件夹和 SSIS 包的所有“授予”权限。
我们可以在 executions 表中看到没有创建任何执行,因此该调用似乎出了点问题。当与 SQL Profiler 连接时,我们看到返回相同的错误,但没有更多关于错误的上下文;离开是无影无踪的。
关于如何调试或解决此问题的任何指示/想法?
【问题讨论】:
-
您是通过发送端口还是助手类运行它?
-
通过发送端口(基于模式)。对存储过程本身的调用是有效的,因为当我们使用 cmets 中的内容调用它时,它执行时没有任何问题。
-
你能告诉我们架构是什么样的吗?
-
我将架构添加到我最初的问题中。架构消息根据架构进行验证。当我们从存储过程中删除所有内容时,它就可以正常工作了。
-
尝试使用 SQL Server PRofiler 捕获生成的实际 SQL 调用,看看是否有帮助。
标签: sql-server ssis biztalk