Results 1 to 4 of 4

Thread: [RESOLVED] nvarchar or varchar that is the question

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Resolved [RESOLVED] nvarchar or varchar that is the question

    We are doing a software upgrade and data migration from an Access 2000 app using SQL server 2000 to a .NET fromtend with SQL server 2005 backend. It is about 50% purchased app with 50% custom code added.

    Now the question. The app has changed to using nvarchar. So all thier tables use that. Our tables use varchar. Should we keep them that way? Should we change to nvarchar for consistency? As far as I can tell we don't explicitly use unicode chars anywhere so will changing just increase network traffic and the storage on the DB? Is there any benefit at all to using nvarchar?

    Thanks.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: nvarchar or varchar that is the question

    The benefit is being able to support unicode... if you know without a doubt you will never, ever support unicode... it's probably negligible... but if there's a chance... go ahead and make the changes. It might mean slight increase in network traffic, but it should be negligible... for DB storage... by it's very nature unicode does take up more space... but not enough to discount it. As long as you aren't maxing out your nvarchar fields on hundreds of thousands of rows, you shouldn't notice much of a difference.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: nvarchar or varchar that is the question

    The difference between nvarchar and varchar is that nvarchar can store unicode characters that varchar can't, so if there's the remote possibility that unicode chars will be stored then use nvarchar now, otherwise leave it as varchar (note access databases use varchar to store text, there is no unicode storing option that I know of)

    Using nvarchar does take up more storage space, even if the fields are blank in the table(s) so I wouldn't use it at all if I know that unicode chars will never need to be stored.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: nvarchar or varchar that is the question

    OK, thanks guys. It seems it doesn't matter much either way. I shared your comments with the other programmer and we do not have any plans to use unicode, and since it requires no work to leave them alone, that is what we chose, do nothing and leave them as varchar.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width