Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

XML String Datatype default and max Length issue Expand / Collapse
Author
Message
Posted Monday, December 01, 2008 6:31 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, October 25, 2012 9:18 AM
Points: 522, 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
Post #611266
Posted Tuesday, December 02, 2008 10:07 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, October 25, 2012 9:18 AM
Points: 522, 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)
Post #612209
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse