Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Location
    Kingston, Ontario
    Posts
    106

    Unanswered: To Varchar or NVarchar, that is the question

    I have a table with a Varchar field that will contain encrypted data. Since each byte can have a value from 0 through 255, can I use Varchar or should I change the field to NVarchar? The reason I ask is that during testing, the Varchar field sometimes is truncated, supposed to be 16 bytes but ends up as 5 or 6 or something less than 16.

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Huh?

    Unless you need to deal with different languages you will use varchar

    can you post some sample code where you are having a problem?

    Why not read the sticky at the top of the forum and post what it asks for
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Brett's suggestion is excellent. I'd read the sticky and post what it suggests, since that ought to get you a complete and correct answer to your question.

    Based on just what you've provided so far, I'd probably consider using VARBINARY(16) instead of VARCHAR(16).

    -PatP

Posting Permissions

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