Applying XML schema to SQL Server throws error "cannot create a row of size 8086..."
In both SQL Server 2005 and 2008, I've experienced intermittant errors when scripting XML schemas. When an XML field in a table goes through mutliple updates, this error is thrown:
Msg 511, Level 16, State 1, Line 5
Cannot create a row of size 8086 which is greater than the allowable maximum row size of 8060.
The error typically happens when an "Alter Table Alter Column XML" syntax is run to detach the XML schema before dropping the schema, re-creating it, and another "Alter Table Alter Column XML(schema name)" to re-attach it.
The current work-around is to re-create the table when the error happens, re-run the script that is erroring out, and now the script completes successfully.
Is there a 开发者_JAVA技巧way to structure a SQL table XML column to have this not happen? This never happens on the initial script execution. After a project has been live, there are updates to the schema, and that's when the intermittant error mentioned above occurs.
This error does not appear to be related to XML text length or length of existing data in the XML fields.
I appreciate any input or if anyone has experienced a similar error.
I may have the wrong end of the stick here but I'm not aware of an XML data type - Any stored string will be limited to the length of the underlying column - you have a number of choices (I think)- NVARCHAR, NVARCHAR(MAX), TEXT ??
精彩评论