Sunday, February 19, 2012

6.5 SQL - Help! - Change column type?

Please Help!
I have a column of type CHAR(255). However, a situation has arose in which
it needs to be larger. I would like to able to change the type to TEXT, but
I can't find any way to do this. What can I do?
Thanks for any help.In SQl 6.5 there is no option ALTER COLUMN in ALTER TABLE statement. Only
way is
1. Export the data out (BCP OUT)
2. Script the table structure including indexes and constraints
3. Drop the table
4. Create the table , change the CHAR(255) data type to Text data type
5. Import the data back (Use BCP IN)
Note:
If it is production, pls do a trail run in test server before doing.
Thanks
Hari
MCDBA
"William" <maxc@.provide.net@.provide.net> wrote in message
news:u3iuyIoEEHA.2076@.TK2MSFTNGP09.phx.gbl...
> Please Help!
> I have a column of type CHAR(255). However, a situation has arose in which
> it needs to be larger. I would like to able to change the type to TEXT,
but
> I can't find any way to do this. What can I do?
> Thanks for any help.
>|||You need to re-create the table. Pre-7 didn't support changing column attrib
utes.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"William" <maxc@.provide.net@.provide.net> wrote in message news:u3iuyIoEEHA.2076@.TK2MSFTNGP0
9.phx.gbl...
> Please Help!
> I have a column of type CHAR(255). However, a situation has arose in which
> it needs to be larger. I would like to able to change the type to TEXT, bu
t
> I can't find any way to do this. What can I do?
> Thanks for any help.
>

No comments:

Post a Comment