May 5, 2003 at 3:54 pm
anyone know how to alter a column to varchar from text datatype?
thanks!!
exec('Alter table ' + @tbl + ' ALTER COLUMN ' + @col + ' VARCHAR(500)' )
/********ERROR***************/
Server: Msg 4928, Level 16, State 1, Line 1
Cannot alter column 'Mytext' because it is 'text'.
also i try to catch the @@error, it doesn't return anything.
May 5, 2003 at 5:01 pm
I do not believe you can do this. you;d have to rebuild the table, which is what EM does if I remember right. Basically, rename your table, create a new one, then copy the data into the new one from the old and drop the old table.
Steve Jones
May 5, 2003 at 5:04 pm
thanks Steve!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply