change nvarchar (50) field to (max)

Posted on 2009-12-16
Last Modified: 2012-05-08
how do i update the data type of a field in a production DB from nvarchar(50) to nvarchar(max)
when i try this in design view in sql 2005 i get a message that said the table needs to be dropped and re-created. this is not good.

any other options that will work on a production DB ?
Question by:supergirl2008
    LVL 75

    Accepted Solution

    ALTER table tableName
    alter column columnName nvarchar(max)
    LVL 13

    Expert Comment

    This worked for me..
    create table c1(a nvarchar(50));
    alter table c1 alter column a nvarchar(max);

    Open in new window


    Author Closing Comment

    strange that i got the error that the table needs to be dropped and recreated, but the change was done on the table regardless.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    results of a query into a new table into sql 5 40
    Access DLookup 18 22
    Select distinct 25 44
    SQL 2005 - Memory Table Column Names 11 57
    SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
    This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now