I'm trying to Insert two columns from one table onto another. The first column is an int but the second column is an XML. I'm having issues inserting the xml column
In first SQL Task I'm doing a select of the the two columns and storing this information into an object.
In the for loop I'm passing on the information :
And in the Result set I'm declaring the variables :
I know that the Form_XML_Text is set to Varchar here but there is not XML option.
And running this insert statement:
INSERT INTO TEST
VALUES (?,?)
This is the error message I'm getting back:
Best Answer
This can be done by converting the XML column when initially selecting it then casting it back to an XML data type for the insert. This is outlined in further detail below.
NVARCHAR
data type. Keep theForm_XML_Text
variable as a string data type.NVARCHAR
data type on the Parameter Mapping pane.Insert Example: