Showing posts with label ntext. Show all posts
Showing posts with label ntext. Show all posts

Tuesday, February 14, 2012

Converting text data to ntext data

Hi all,

My organization have a web-based application and needs it to support multilingual so we will be adapting our app to use unicode. However, one of our problems is to convert existing data from text to ntext. I couldn't find anything that document this. What is the best way to do that? I would like to be able to migrate the data from an existing text column to another ntext column in the table.

I brief you about my system, I used List manager system to store the messages and distribute to all members. Right now,by design the Lyris system keep the message in the text field which mean it 's not support multilanguage directly because of unicode field. We needs to create new Db which has the data structure as same as Lyris but just one difference is keep the message in unicode format (ntext) which we need the sql script to automatically update the new record get from Lyris to new DB.

If I can't do that, what are the options? If it's possible, I would like to be able to do this in sql script.

Thanks a mil, in advance.

Eddie

Moving to engine folder.|||

You should be able to accomplish this by using a command similar to the following:

ALTER TABLE table_name ALTER COLUMN column_name ntext

go

After that you should run DBCC CLEANTABLE command to reclaim space occupied by old column. Also you space requirement for the altered column will double (just plan for that).

Alternatively, you can bulk copy your data out, modify the table definition, truncate the table and bulk copy data back in.

HTH,

Boris.

Friday, February 10, 2012

Converting Non-Unicode to Unicode

What is the best way to convert a large 24/7 database to Unicode? We have
various varchar and text fields that need to become nvarchar and ntext
respectively. I know I can alter the tables to do the varchars, but that
would have to be offline (looks like like about 2 hours per column on my
50 million record table). Text fields can't be converted with an alter so
they have to be copied to a new column. I was just wondering if anybody
has experience converting these.In article <38E5F8AA-A720-4E27-A01F-9BB364263191@.microsoft.com>,
satyaskj@.yahoo.co.uk said...
> Why not design another table with new datatypes and use DTS or BULK insert to import data from the old table.
> Once data is propogated delete the old table and rename new to old to handle the application.
Because I need to do it as on-line as possible. If I do a copy I will
have to shut down the site before I begin and I know it will take quite a
while.