XML Sql Data Type

DVS Developers asked on July 15, 2015 15:44

Hi,

I'm getting the following error when I try to to sync to a staging server:

SyncServer.ServerError: Exception occurred: [TableManager.UpdateTableByDefinition] SQL type 'xml' is not registered as a default type, change type to 'nvarchar(4000)' or register the type using DataTypeManager.RegisterDataTypes(...)

I understand why it has happened (I changed the datatype in the DB to XML because thats what I need) but how do I fix this issue?

The error references 'DataTypeManager.RegisterDataTypes'. Can I use that?

Recent Answers


Brenden Kehren answered on July 15, 2015 16:42 (last edited on July 15, 2015 16:42)

I'd recommend against direct database changes, especially to system objects like staging. Making this change will cause problems with upgrades and everything else along the way.

Why is it you needed to change the datatype and what are you looking to do?

0 votesVote for this answer Mark as a Correct answer

DVS Developers answered on July 15, 2015 17:00

We need the data field in XML mostly because we are migrating and the original database has XML fields which we want to preserve. We might have stored procs that use the SQL XML functions too. Is there any plans to allow DB fields to be XML data type?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 15, 2015 20:57

How are you migrating? Or are you upgrading?

Guess I've never had to convert any of the table columns to a different datatype to retain/preserve the data. Currently there are several system tables that allow xml although I don't believe they are of type xml, I believe they are nvarchar.

0 votesVote for this answer Mark as a Correct answer

DVS Developers answered on July 16, 2015 10:05

We're migrating an existing product into kentico. Also, the maximum kentico seems to allow a text field length is 4000. Some of the XML is very large...

Of course there are ways to minify the xml content but even if we do that we'd have to cast those fields to XML to enable our current SPs to work the same way

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 16, 2015 20:58

A text field by default is set to nvarchar(4000). If you choose long text, it is set to nvarchar(max). This should extent the field to 8000. So I'd suggest changing your field to a long text field within the UI. I'm assuming you're importing this data into a new page type but I could be wrong.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.