1

How can I alter a column of type text in a SQL Server 2000 table, and change it to varchar?

I tried with

ALTER TABLE myTable
ALTER COLUMN myColumn varchar(8000) NULL
GO

and the error is

No se puede modificar la columna 'MyColumn' porque es 'text'

2
  • 2
    You may have to add a new column, perform an update (perhaps in batches), drop the old column, and rename the new column. Note that this isn't a limitation in modern versions of SQL Server... why is the question tagged with 2008 R2? You shouldn't get an error there. – Aaron Bertrand Jan 12 '15 at 19:14
  • Thansks Aaron, utilice your solution – Diego Flores Jan 13 '15 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.