Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 converting existing database(ASCII) to unicode

Author  Topic 

doyin
Starting Member

2 Posts

Posted - 2006-10-03 : 18:23:39
i have a database that is running using regular ascii characters.. i am trying to migrate this database to support several other languges(globalization). I need ideas on how to migrate this database to UTF 8 .
Someone suggested converting all the varchar and char to nvarchar and nchar .. but i have a lot of data on the system and this might take a lot of time..
Any ideas would be appreciated !!!!

Kristen
Test

22859 Posts

Posted - 2006-10-04 : 02:12:01
Basically you need to:

Create TEMP_MyTable

with all varchar / text changes to nvarchar / ntext


INSERT INTO TEMP_MyTable SELECT * FROM MyTable

DROP MyTable

sp_rename 'TEMP_MyTable', 'MyTable'

You will also need to deal with constraints, FKs, la-di-dah-di-dah ...

The easiest way I know of is to make the changes in Enterprise Manager's Design Table and then use the "Generate Change Script" icon to create the script, and then abandon the changes in E.M.

Note that (SQL2000) the maximum size for Nvarchar is 4,000 - whereas Varchar is 8,000 - that might give you some problems!

You probably don't need to change ALL your varchar columns - and each one that you do will result in a double of disk storage for that column of course

Also note that normal Varchar can hold quite a lot of foreign character accents - not Chinese but most of the Roman alphabet languages

Kristen

Kristen
Go to Top of Page

doyin
Starting Member

2 Posts

Posted - 2006-10-05 : 10:16:09
thanks for the response.. am taking a look at that approach
quote:
Originally posted by Kristen

Basically you need to:

Create TEMP_MyTable

with all varchar / text changes to nvarchar / ntext


INSERT INTO TEMP_MyTable SELECT * FROM MyTable

DROP MyTable

sp_rename 'TEMP_MyTable', 'MyTable'

You will also need to deal with constraints, FKs, la-di-dah-di-dah ...

The easiest way I know of is to make the changes in Enterprise Manager's Design Table and then use the "Generate Change Script" icon to create the script, and then abandon the changes in E.M.

Note that (SQL2000) the maximum size for Nvarchar is 4,000 - whereas Varchar is 8,000 - that might give you some problems!

You probably don't need to change ALL your varchar columns - and each one that you do will result in a double of disk storage for that column of course

Also note that normal Varchar can hold quite a lot of foreign character accents - not Chinese but most of the Roman alphabet languages

Kristen

Kristen

Go to Top of Page
   

- Advertisement -