Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 626
  • Last Modified:

Storage Difference between varchar and nvarchar

I have a table with two fields. Both are nvarchar in type. I have 100,000 records in this table.
I have stored normal characters only in those fields, it doesn't have any international characters. If i change the datatype from nvarchar to varchar, Will the storage size of that table decreases?

0
ynaina
Asked:
ynaina
  • 2
1 Solution
 
illCommented:
sizeOf( varchar)= 0.5* sizeOf ( nvarchar)
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
Differences are
1. Nvarchar can store non unicode characters such as Arabic, Hindi etc, but varchar can't
2. nvarchar needs double the storage space needed for a varchar

> If i change the datatype from nvarchar to varchar, Will the storage size of that table decreases
If the field was previously say nvarchar(4000) and you changed it to varchar(4000),then it will need half space for storage

0
 
ynainaAuthor Commented:
any data loss can happen in this process
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
If you dont have unicode characters , nothing will loss
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now