Sunday, February 19, 2012

Copy text columns to nvarchar

Hi,

I have a problem, I have a table with a text type column and a
nvarchar(2000) type column on my MS SQL 2000 Server.

I know that the longest text in the text field is 1000 chars. I want to
copy the content the content of the text field into the nvarchar field.

I tried convert and cast but after the update there are only 255 chars
in the nvarchar field.

Best regards
MarcMarc Filthaut (usenet_delete_for_reply@.filthaut.com) writes:
> I have a problem, I have a table with a text type column and a
> nvarchar(2000) type column on my MS SQL 2000 Server.
> I know that the longest text in the text field is 1000 chars. I want to
> copy the content the content of the text field into the nvarchar field.
> I tried convert and cast but after the update there are only 255 chars
> in the nvarchar field.

I don't believe that. Add a len(nvarcharfield) to you query and you
will make a revelation.

The next step of this operation is to go Tools->Options->Results and
change the setting Max characters per column.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hi,

Erland Sommarskog wrote:
> Marc Filthaut (usenet_delete_for_reply@.filthaut.com) writes:
> The next step of this operation is to go Tools->Options->Results and
> change the setting Max characters per column.
Thanks this was one of the solutions.

Best regards
Marc

No comments:

Post a Comment