473,785 Members | 3,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

varchar and nvarchar issue

Hi

The maximum length of a nvarchar could be 4000 characters while that of
varchar could be 8000.

We are trying to use unicode which would require that the datatype for
one our fields be converted from varchar to nvarchar. But looks like
this would result in loss of existing data.

Is there a way to do this without loss of data?

Many thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
2 9070

"Vani Kancherlapalli" <vk************ *@linkage-inc.com> wrote in message
news:3f******** *************@n ews.frii.net...
Hi

The maximum length of a nvarchar could be 4000 characters while that of
varchar could be 8000.

We are trying to use unicode which would require that the datatype for
one our fields be converted from varchar to nvarchar. But looks like
this would result in loss of existing data.

Is there a way to do this without loss of data?

Many thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


If you need to have more than 4000 Unicode characters in a column, then you
can either use ntext, which goes up to 1GB, or split the text into multiple
rows in a dedicated table. Since nvarchar(4000) is 8000 bytes, and the
maximum row length is 8060 bytes, there would be no way to get the data into
a single row without using ntext. If you do use ntext, check the Books
Online details on text data - there are some special considerations.

Simon
Jul 20 '05 #2
Could use an Image field or ntext field to store the data - but will get
performance hit from doing so.

"Vani Kancherlapalli" <vk************ *@linkage-inc.com> wrote in message
news:3f******** *************@n ews.frii.net...
Hi

The maximum length of a nvarchar could be 4000 characters while that of
varchar could be 8000.

We are trying to use unicode which would require that the datatype for
one our fields be converted from varchar to nvarchar. But looks like
this would result in loss of existing data.

Is there a way to do this without loss of data?

Many thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6581
by: Junkmail | last post by:
I have an application with highly compressable strings (gzip encoding usually does somewhere between 20-50X reduction.) My base 350MB database is mostly made up of these slowly (or even static) strings. I would like to compress these so that my disk I/O and memory footprint is greatly reduced. Some databases have the ability to provide a compressed table, compressed column, or provide a user defined function to compress an indvidual...
4
2043
by: wriggs | last post by:
Hi, This is probably an easy question for someone so any help would be appreciated. I have changed the columns in a table that where nvarchar to the same size of type varchar so halve the space needed for them. I have done this a) becuase this is never going to be an international application, b) we are running out of space and c) there are 100
0
5526
by: Jean-Michel POURE | last post by:
Dear friends, I studying the possibility to port Compiere CRM from Oracle to PostgreSQL. As Compiere evolves nearly everyday in CVS, I would like to run the Oracle code without (too much) modification. Don't blame me, I know using search/replace works most of the times. At first, I used CREATE TYPE syntax to map Oracle nvarchar2 to PostgreSQL varchar type (see code #1). The code seems to be the equivalent of:
4
9904
by: Hazzard | last post by:
What is the best way to do this? Binary with 0 representing off and 1 on? Int16 with 1 representing first button, 2 the second, 3 ... varchar with a character values at certain positions in the string representing radio button values. Thanks, -hazz
4
13008
by: D. | last post by:
Hi, I'm starting a new application in java using JTDS jdbc driver (http://jtds.sourceforge.net) and SQLServer 2005 Express. I have to design the database from scratch and my doubt is if I have to use varchar or nvarchar fields to store string data. Any experience about performance issues using nvarchar instead of varchar (considering that Java internally works in unicode too)? Thanks in advance, Davide.
1
27121
by: Srikanthk | last post by:
Dear Sir, What is the Difference using varchar and nvarchar in Oracle 9i.
4
2153
by: stuckish | last post by:
My collegue is saying that you should store text data in Sql Server i unicode fields (nvarchar) beause that .net (asp.net website) is all unicode and therefore you save some time not having to convert the data from ascii to unicode. So i thought that i should ask you experts what you saying about it? What is best for performance if you do not have to store any unicode
5
18343
by: haidani | last post by:
Hi, I am new to MS SQL. When I create a column in a table, when shall I use nvarchar or varchar? Please help. Thanks, Mike
2
6169
by: bharathreddy | last post by:
Here i will show the differences between nvarchar and varchar: The difference is that nvarchar is used to store unicode data, which is used to store multilingual data in the database tables. Other languages have an extended set of character codes that need to be saved and this datatype allows for this extension. If the database will not be storing multilingual data we should use the varchar database instead. The reason for this is that...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.