This is because EM will create a temporary table, copy your data over, and then drop 
the original table, recreate it, and then insert the old data into there and drop the 
temp table.

----- Original Message -----
From: Stan Winchester <[EMAIL PROTECTED]>
Date: Tuesday, August 5, 2003 10:45 am
Subject: alter table question

> I just tried to convert a column from text to varchar in query 
> analyzer using "ALTER TABLE dbo.tbl_Items ALTER COLUMN Item 
> varchar(50)""ALTER TABLE [table name] ALTER COLUMN [column name] 
> [datatype]"
> The above example threw the following error:
> 
> Server: Msg 4928, Level 16, State 1, Line 1
> Cannot alter column 'Item' because it is 'text'.
> 
> However, I could change the datatype in Enterprise Manager from 
> text to varchar with no problems. NOTE: You will need to remove 
> any Contraints on the affected field before changing the datatype, 
> and then reapply any contraints as needed.
> 
> It seems the alter statement works fine between varchar and int, 
> but not from text. There may be other datatypes that cannot be 
> converted through query analyzer, but might be alterable in 
> enterprise manager. Maybe some SQL guru might enlighten us all.
> 
> Stan Winchester
> 
> >is there a query analyzer way to alter the column datatype?
> >
> >I have some text columns that should been varchar, and I need to 
> change>them...i don't care about losing data, since its only 10-25 
> characters>per cell...
> >
> >thanks!
> >
> >tony weeg
> >uncertified advanced cold fusion developer
> >tony at navtrak dot net
> >www.navtrak.net
> >office 410.548.2337
> >fax 410.860.2337
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to