Monday, February 20, 2012

Migrating to Internationalized Datatypes

Hi,
Can anyone tell me how can I move my existing datatypes to
Internationalized datatypes in SqlServer2000. i.e
CHAR to NCHAR
VARCHAR to NVARCHAR
TEXT to NTEXT
I am facing two Problems when I use Alter table Command to Modify the Column
Datatype.
1)
When I try to alter CHAR Column to NCHAR that has Index Defined, SQL
Server gives an error ( Alter Column failed because One or more Objects
access this column )
I tried by disabling the constraints on the table, but that also did not hel
p.
2) Conversion From TEXT to NTEXT seems to be Unsupported . On Alter of
text Column Error comes, Cannot alter column because it is 'text'
Thanks,
AnujHi
I would create an identical table in the DB with the new table structure.
Then use SELECT/INSERT statements to copy the data over, or use DTS to map
the columns and then let DTS copy the data over.
Rename the original table and then re-name the new table to the original
table.
Re-create all constraints, Clustered Indexes and other indexes.
In-place changes will cause a lot of data movement, pages splits and updates
to indexes, making it a slow process. As the same time, with doing the copy
to a new table, you can first verify that everything looks good before you
proceed with re-naming tables.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Anuj Gupta" <Anuj Gupta@.discussions.microsoft.com> wrote in message
news:3076DEC3-4E4A-4873-96F8-692D4D335E05@.microsoft.com...
> Hi,
> Can anyone tell me how can I move my existing datatypes to
> Internationalized datatypes in SqlServer2000. i.e
> CHAR to NCHAR
> VARCHAR to NVARCHAR
> TEXT to NTEXT
> I am facing two Problems when I use Alter table Command to Modify the
Column
> Datatype.
> 1)
> When I try to alter CHAR Column to NCHAR that has Index Defined, SQL
> Server gives an error ( Alter Column failed because One or more Objects
> access this column )
> I tried by disabling the constraints on the table, but that also did not
help.
> 2) Conversion From TEXT to NTEXT seems to be Unsupported . On Alter of
> text Column Error comes, Cannot alter column because it is 'text'
> Thanks,
> Anuj

No comments:

Post a Comment