Alter column datatype from text to varchar

  • when i use SQL query analyzer to alter the column ALTER TABLE MyTable ALTER textCOLUMN MyColumn VARCHAR(20).I get the error Server: Msg 4928, Level 16, State 1, Line 1

    Cannot alter column 'productdescription' because it is 'text'.

    But on the other side in Enterprise Mgr it allow me to change .can anybody help .Thanks

    Munish

  • Unfortunatly in SQL 2000 you can not convert from text directly. What enterprise manager is doing behind the sceens is creating a temp table, loading it with the data from the orriginal table, droping the old table and renaming the temp table.

    In SQL 2005 the alter column works fine.

    Kenneth Fisher

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • Thanks for your help

    Munish

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply