Search code examples
t-sqlsql-server-2000

SQL Server 2000 - How do I alter a column from text to ntext?


I'm trying to do a ALTER TABLE Signatures ALTER COLUMN HTML ntext; but I get a Cannot alter column 'HTML' because it is 'text'.

How do I go about altering the column?


Solution

  • Or you could rename HTML to HTMLOld and then create a new column HTML that is ntext. Then update the new column with the data from HTML old, then drop the HTMLOld column.

    (Incidentally when you move away from SQL Server 2000, you need to start getting rid of these text and ntext columns as they are deprecated and will not be available in the next version of SQL Server.)