Question

I am trying to run the SQL Transport Schema Generation Wizard against a SQL 2012 server. The stored procedure has a datetime parameter. If i simply put in a date like 12/26/2013 05:00:00 Am, then the "Generate" button doesn't show an argument. If i try putting the date/time in a single quote or using a string like 2013-12-26T05:00:00.000, the parameter is generated, but i get the following error when i try to execute. "Failed to execute SQL Statement. Please ensure that the supplied syntax is correct. "

I got to this point by creating a SQL Query that output it's response using FOR XML AUTO, ELEMENTS in it. I then open my BizTalk solution in VS 2012, Go to "Add Items -> Add Generated Items". Select Add Adapter Metadata. From there, it asks the location of the message box. I use my local server. It then asks for the connection string for the SQL Server with the stored procedure. I enter that (it's the same as the server with the message box). I specify the namespace and the root element name for the document. This is set as a receive port. I next select stored procedure and move to the next screen. I then select the stored proc from a drop down list. Below, in a grid, i am shown the parameters for the stored proc. Here is where i am having trouble. I cannot seem to get it to accept the datetime argument no matter what i put in here.

Is there something i am doing wrong?

Was it helpful?

Solution

It is better to do the following steps and to use the new WCF-SQL rather than the old deprecated SQL adapter.

  1. Add Items
  2. Add Generated Items
  3. Consume Adapter Service
  4. Select sqlBinding and Configure the URI
  5. Click Connect
  6. Select Client (Outbound operations)
  7. Select Strongly-Type Procedures
  8. Select the Stored Procedure from Available categories and operations
  9. Click Add
  10. Give it a Filename Prefix
  11. Click OK

This will generated the schemas plus binding files to create the port. You also don't need to have the FOR XML AUTO, ELEMENTS in your stored procedure any more.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top