Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fergus Davidson 309 posts 588 karma points
    Oct 04, 2010 @ 14:25
    Fergus Davidson
    0

    change datatype without data loss - is this possible

    hi

    i have used tree multi picker in a site [v4.0.4.2]

    the datatype is currently nvarchar but the client needs to add so many items that i have run out of space in the field.

    what i would like to do is either:

    1 - change the length of the field for the datatype 'nvarchar'

    or

    2 - change the datatype to ntext

    i have tried the second approach which then meant that all these items were then empty. i changed it back and 'bingo' they all came back, *phew

    i had a little dig and it seems that all the data is contained in the table: [cmsPropertyData]

    this table has distinct columns for the data.

    i presume that if i move the data from one column to the other and republish the pages, then all should be ok.

    is this right??

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Oct 04, 2010 @ 14:32
    Dirk De Grave
    1

    Should also do the trick (I've suggested the 1st approach in other post). I even think the 2nd one is preferred, as it doesn't change the db structure.

     

    Cheers,

    /Dirk

  • Marco Lusini 176 posts 1370 karma points
    Oct 04, 2010 @ 14:39
    Marco Lusini
    1

    Yes, I also think that 2 is preferred here. It should suffice to copy data from one column to the other, without any further republishing (not sure)...

  • Fergus Davidson 309 posts 588 karma points
    Oct 04, 2010 @ 17:41
    Fergus Davidson
    1

    thanks both.

    For anyone else's interest, i merely copied the 'dataNvarchar' column to the 'dataNtext' column for the given datatypeID.

    this meant that both columns were filled with the data

    returning to umbraco, i then altered the datatype to reflect the change from nVarchar to nText.

    Finally, on trying to update the content node, this was now successful. a quick check on the database record showed that the 'dataNvarchar' column is now NULL, and the data is stored, as intended, in the 'dataNtext' column.

    It is worth noting, perhaps, that the temporary presence of data in both columns seems to have no detrimental effect, the data is cleared from the unused column on the next publish of that content node.

    thanks again dirk and marco

Please Sign in or register to post replies

Write your reply to:

Draft