# Database Discussions > MS SQL Server 7/MS SQL Server 2000 >  nvarchar to varchar

## DeadManWalking

I have a table using nvarchar(for what ever reason which beyond me why its a nvarchar...) that I would like to change to a varchar.  There is no unicode in the fields so I don't have to worry about but I don't want to lose any text data.  Will coverting the data type lose data?

Thanks

----------


## skhanal

No.

Before you change column who don't you query the table like

select cast(col as varchar)
from table

and see if you see anything missing.

Also make a backup of the table,

select * into newtable from table

----------


## MAK

No. I dont think you will lose any data. The column size will be reduced to half (instead of 2 byte storage it stores 1 bye for every character)

Example
use tempdb
go

create table x1123 (name nvarchar(10))
go
insert into x1123 select 'abcdefgxcv'
go
alter table x1123 alter column name varchar(10)
go
select * from x1123

go
create table x112 (name nvarchar(100))
go
insert into x112 select 'abcdefghijklmnopqrstuvwxyz1234567890'
insert into x112 select 'abcdefghijklmnopqrstuvwxyz1234567890'
insert into x112 select 'abcdefghijklmnopqrstuvwxyz1234567890'
insert into x112 select 'abcdefghijklmnopqrstuvwxyz1234567890'
insert into x112 select 'abcdefghijklmnopqrstuvwxyz1234567890'
insert into x112 select 'abcdefghijklmnopqrstuvwxyz1234567890'

select * from x112
alter table x112 alter column name varchar(100)
select * from x112

----------


## DeadManWalking

In case anyone was wondering, it did work.  Thanks for the help.

----------


## DLu

If my company is only dealing with U.S. customers, I Should use varchar instead of NVarchar which will cost me double space. Is this assumption right? Is the nvarchar for international affairs?

-D

----------


## rmiao

You don't need nvarchar unless use unicode characters.

----------


## MAK

international affairs? I dont think so.

For all unicode characters of different languages.

To store characters like in the link below

http://www.unicode.org/standard/WhatIsUnicode.html

----------


## DLu

MAK and all, thanks for the unicode address info.

So, for the long term, indivdual database should adopt the unicode standard, or NVarchar... as the standard of database storage characters in order to communicate with different type of languages and different platforms.
Thus, the only reason that need to convert from NVarchar to Varchar is for space issue?!
-D

----------


## rmiao

You can store up to 8000 characters in varchar column, but only 4000 in nvarchar column. And table reponses faster if has less pages.

----------


## DeadManWalking

Really 4000 is not really a good view on how much nvarchar will hold.  If you have more than one nvarchar field, you may not be able to put 4000 in each nvarchar field.  The problem that prompted my question was that I was exceeding the max row size for a table.  I was easily under the character number for my fields but combined they reached beyond the max row size.  I wanted to covert the fields to varchar because they store data in a smaller size(refer to MAK's post).  In my instance, I couldn't place any where close to 4000 char's in each of my nvarchar fields.

----------

