Copied to clipboard

Flag this post as spam?

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


  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jun 28, 2011 @ 17:46
    Lee Kelleher
    1

    Switch dbType from Nvarchar to Ntext without data loss

    On one of my Umbraco installs, I'd like to switch a data-type from using the old Tree Multi Picker control to the uComponents MultiNode Tree Picker control. The problem I have is that I originally set the underlying dbType to Nvarchar - and I know that MNTP uses Ntext to store the data/value.

    Quick test of this shows that the data/value doesn't persist across Nvarchar and Ntext ... so the question is how to best do this?

    I did find an old forum topic about this, but there was no real solution - aside from "hacking around in the database tables".  I could easily do this myself - but I'm hoping that there's a more elegant answer out there ... even if it means that we need to create a new package/dashboard-control for it.

    Any ideas, suggestions? (Hoping there's a package out there that already does this)

    Thanks, Lee.

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jul 08, 2011 @ 09:55
    Lee Kelleher
    1

    Following up on my own topic... I ended up doing a SQL UPDATE on the cmsPropertyData table:

    UPDATE
        cmsPropertyData
    SET
        dataNtext = dataNvarchar
    FROM
        cmsPropertyData AS d
        INNER JOIN
        cmsPropertyType AS t ON t.id = d.propertytypeid
    WHERE
        d.dataNvarchar IS NOT NULL
        AND
        d.dataNvarchar != ''
        AND
        t.Alias = 'promoNodes'
    ;

    Didn't have time to build a nice UI for this functionality ... if any one wants to develop something like this, you're free to use this code snippet.

    Cheers, Lee.

  • Douglas Ludlow 210 posts 366 karma points
    Mar 28, 2013 @ 16:36
    Douglas Ludlow
    0

    Thanks a lot for this Lee, it got me on the right track.

Please Sign in or register to post replies

Write your reply to:

Draft