XSD: type of column x in table y is too small to hold data

sqlbulkcopy sql-server-2008 xsd

Question

I am generating an XSD file based on the columns in my xml. I give them all the type, "xs:string". Then I try to import the file into my database using .NET with SQLbulk import, but for some fields are to small. I get the message, "type of column x in table y is too small to hold data"

What type should I use for large amount of text (so to generate a text field in the database using sqlbulk.execute)? The current one creates a nvarchar(1000) field, and the data in some fields is bigger

Accepted Answer

The trick was to add sql:datatype="nvarchar(4000)"



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why