Home Page › Forums › BizTalk 2004 – BizTalk 2010 › SQL Function Call?// › Re: SQL Function Call?//
Do you mean calling a SQL stored procedure passing an Xml document as a parameter?
If so, then you can do this with the SQL Adapter
Create your stored procedure:
CREATE PROCEDURE [dbo].[bts_PassXmlDocument] @XmlDoc ntext
Use the Add adapter metadata to create the schema for the stored procedure.
Promote the XmlDoc field from this schema as a Distinguished Field.
Generate a schema for the Xml document you wish to pass.
In an orchestration create a message for the SQL Stored Procedure schema (msgSQLMessage) and a message based on the Xml Document schema(msgXmlDoc) and declare an orchestration variable of type System.Xml.XmlDocument (varXmlDoc)
In a message assignment shape:
varXmlDoc = msgXmlDoc;
msgSQLMessage.bts_PassXmlDocument.XmlDoc = varXmlDoc.OuterXml;
Send the msgSQLMessage to SQL Adapter send port.