locked
alter column ntext to nvarchar(max) null values are not retained RRS feed

  • Question

  • Inconsistant behaviour.

    I am having one old database and want to change the deprecated types in it. In one of the table for column 'MULTILINETEXT' I changed its type from ntext to nvarchar(max). Currently all values are null in the table for column 'MULTILINETEXT' but after changing the type the values become blank(non null).

    When i copy same table in to new table using select * into the change in types for new table behaves fine and null values retained.

    But with original talbe Null becomes blank(i.e. not null)


    Manish
    Monday, October 12, 2009 6:55 AM

All replies

  • Hello Manish

    What version of SQL are you using? (SELECT @@version)

    How are you running the initial (unsuccessful) convert - through the GUI or ALTER TABLE?

    Regards

    Ewan

    If you have found this post helpful, please click the 'Vote as Helpful' link (the green triangle and number on the top-left).

    If this post answers your question, click the 'Mark As Answered' link below. It helps others who experience the same issue in future to find the solution.
    Monday, October 12, 2009 10:17 AM