user3911919
user3911919

Reputation: 43

BizTalk 2013 - execute stored procedure on send port without orchestration?

A while back I set up BizTalk to pick up a file via FTP and drop it into a network directory. It's all passsthru so I didn't use an orchestration.

Now I've been asked to execute a stored procedure once the file is picked up. The procedure contains no parameters and I do not need the contents of the file.

It seems like such a simple request but I can't figure it out. Is there any way to do this without over complicating things?

Upvotes: 3

Views: 2316

Answers (2)

Hasse
Hasse

Reputation: 21

This can be accomplished through the use of either the WCF-SQL adapter or the WCF_Custom adapter with a SQL binding. You can do this using messaging only with just a SendPort with a filter/map on it thus no orchestration needed.

For the SOAP action header use TypedProcedure/dbo/name_of_your_stored_procedure and in the messages tab you can specify the paramters to the stored procuders as well as add a payload in the following manner:

<name_of_your_stored_procedure xmlns="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo">
  <parameter1>XXXX</parameter1>
  <xml_parameter>
    <bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="string"/>
  </xml_parameter>
</name_of_your_stored_procedure>

In the above case xml_parameter will have the contents of the message payload passed to it.

The stored procedure should look something like :

CREATE PROCEDURE [dbo].[name_of_your_stored_procedure]
    @parameter1 int,
    @xml_parameter nvarchar(max)
AS
BEGIN
    -- your code goes here
END

More details can be found here

Regards Hasse

Upvotes: 2

James Rosser
James Rosser

Reputation: 424

This MSDN page describes the process and has this to say: "You must create a BizTalk orchestration to use BizTalk Server for performing an operation on SQL Server."

However if you're really desperate not to use an orchestration I believe you have the option of setting the operation context property in a custom pipeline component. Then you can initialise the message in a map on a port. In theory this should work but I can't guarantee it.

Upvotes: 0

Related Questions