Workflow - Import XML Data into MS SQL Database

Hi

I want to inject some of the XML data that is in workflow into a MS SQL database, is there a documented way to do this?

Thanks

Liam

Use the Database Query task in Workflow and specify a Dynamic SQL statement that uses the UPDATE command. Make sure to uncheck the Expect record set option since UPDATE commands do not return a recordset. The Dynamic SQL allows you to specify data values, so for instance, you could use a statement akin to this one:

UPDATE MyTable SET MySQLField=@(1,8,8,1,16,KeepCase,Trim)

Hi Liam,

Sure we can, in order to do this, you must follow the next steps.

  1. After the plugin that has the XML data, you must go to actions on the “plug-in-Bar” and select the “Database Query” plugin and drag it to you workflow, like on the image below.

  1. Now you will be able to see the ”Database Query Properties”, then you must select the second tab “Dynamic SQL” like on the images below.

  1. Then you must to check “Use dynamic values at runtime” and uncheck “Expect record set”, like on the image below.

  1. Then you must click on the icon to set up the connection to your database. Like on the images below.

  1. Then after connect your database, you must go to the “SQL statement” area on the “Dynamic SQL” tab and make your Query to insert your data in to your Database like in the image below.

You can create some variables on your process that will contains your data values and then use it on your SQL query, like on the image below

Then in this way you will be able to insert data from xml file in to your SQL database.

Best Regards,

Juan