Insert XML
I have a string variable that is an xml string that I pass as a parameter to an execute sql task for inserting. On the parameter mapping for the sql task I pick NVarchar or Varchar with a parameter size of -1 and it appears the parameter is cutting off part of the xml file for insertion which is causing validation errors. I have written the string to an xml object and saved it as a file and the xml is valid and matches my schema, so I know its the parameter that is cutting it off. Is the parameter size of -1 equal to varchar(max) because that is what I need? If there is no way to do it through the sql task does anyone else have any ideas?
Thanks,
Adam
December 10th, 2008 1:54am
acfalcon2001 wrote:
I have a string variable that is an xml string that I pass as a parameter to an execute sql task for inserting. On the parameter mapping for the sql task I pick NVarchar or Varchar with a parameter size of -1 and it appears the parameter is cutting off part of the xml file for insertion which is causing validation errors. I have written the string to an xml object and saved it as a file and the xml is valid and matches my schema, so I know its the parameter that is cutting it off. Is the parameter size of -1 equal to varchar(max) because that is what I need? If there is no way to do it through the sql task does anyone else have any ideas?
Thanks,
Adam
to me, an easier approach would be to build the entire sql statement in an ssis variable using an expression.
hth
Free Windows Admin Tool Kit Click here and download it now
December 10th, 2008 9:25am
What is the data type and size of the column you are inserting to?
December 10th, 2008 12:12pm
Sorry I wasn't even thinking of that. That seems to be working great! Thanks!
Free Windows Admin Tool Kit Click here and download it now
December 10th, 2008 6:17pm
Hello,
We may insert XML data through .Net application into the database via the usage of stored procedure. The whole program has
been illustrated in the best way in this link. You may visit it...
http://www.visiontechno.net/studymats/xmlinsertion.html
November 4th, 2010 4:06am