Question

I have table with the columns of type 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?

Was it helpful?

Solution

No. You can alter your tables (Sql 2005+) cf this.

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.

OTHER TIPS

"peculiar reason"? Only that ntext is deprecated and damn difficult to work with?

It's a lossless conversion. If you are unsure, use the SSMS GUI designer to generate scripts for you.

Is there any possibility of data loss for the NVARCHAR(MAX) limitations?

No. NVARCHAR(MAX) allows for twice as much text (2^31-1 vs. 2^30-1) as ntext.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top