Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


XML String Datatype default and max Length issue


XML String Datatype default and max Length issue

Author
Message
Danb7183
Danb7183
Mr or Mrs. 500
Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)

Group: General Forum Members
Points: 524 Visits: 493
Afternoon,

The XML Source Adapter in SSIS has made my life very easy when importing Data for a project I have been working on. However, I am running into a problem in regards to the length of the 'String' type in the Xml Schema Definition file and how this is recognised in SSIS.

Basically, a 'content' attribute within the Article XML file I am using to import is often greater than 4,000 characters. I've previously created a new restriction with the Facet 'maxLength = 8000' but as the following link says SSIS defaults the length to 255 if no maxLength is given: "if a string has a length of 5000, it is truncated to 4000 characters because the maximum length of the DT_WSTR data type is 4000 characters; likewise, byte data is truncated to 8000 characters, the maximum length of the DT_BYTES data type. If the schema specifies no maximum length, the default length of columns with either data type is set to 255"

http://msdn.microsoft.com/en-us/library/ms140277(SQL.90).aspx

So basically I am currently limited to loading up to (and including) 4,000 characters of data in this attribute. This causes a few concerns because I do still want to import the longer articles of text within the XML file. Is there a way round the max Length in SSIS? You can use a DT_NTEXT data type in SSIS but how do you reflect this change in the .xsd file so that SSIS recognises this and allows you to not truncate any data?

Thanks in advance,
Dan
Danb7183
Danb7183
Mr or Mrs. 500
Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)Mr or Mrs. 500 (524 reputation)

Group: General Forum Members
Points: 524 Visits: 493
Well, I managed to get around the problem with help from Roger Doherty from the following link: http://blogs.msdn.com/rdoherty/archive/2005/03/16/396956.aspx

Didn't realise you could change the input/output of the task in Advanced Editor!

So hope this helps out others if they ever come across a similiar situation (and not just with XML files) Cool
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search