patternsqlMinor
Migrating from NTEXT to NVARCHAR(MAX)
Viewed 0 times
ntextnvarcharmigratingmaxfrom
Problem
I have table with the columns of type
While doing so, what all potential threat should I be careful about?
Is there any possibility of data loss for the
NTEXT. And for some peculiar reasons, the client wants to migrate the column type to NVARCHAR(MAX).While doing so, what all potential threat should I be careful about?
Is there any possibility of data loss for the
NVARCHAR(MAX) limitations?Solution
No. You can alter your tables (Sql 2005+) cf this.
Or, for your convenience:
Or you can supply a view which casts the
Or, for your convenience:
alter table my_table alter column my_ntext_column nvarchar(max);Or you can supply a view which casts the
ntext columns to nvarchar(max) to make the client happy and leave your database unchanged.Code Snippets
alter table my_table alter column my_ntext_column nvarchar(max);Context
StackExchange Database Administrators Q#1298, answer score: 6
Revisions (0)
No revisions yet.