Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2003
    Location
    Ottawa
    Posts
    105

    Unanswered: substring on text field

    Hi,

    According to the docs, when using substring on a text field (not varchar):

    Code:
    substring (<text>, start, length)
    ...the length in this case, represents BYTEs as opposed to number of characters. So my question is, how many bytes per character (or characters per byte)....or is this a possible conversion?

    thanks,
    You're obsessed and distressed 'cuz you can't make any sense
    Of the ludicrous nonsense and incipient senescence
    That will deem your common sense useless

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    A TEXT column is 8 bits (one byte) per character, an NTEXT column is 16 bits (two bytes) per character.

    -PatP

  3. #3
    Join Date
    Jun 2003
    Location
    Ottawa
    Posts
    105

    okay

    thanks...

    on text 1:1 ...that's a pretty easy conversion.
    You're obsessed and distressed 'cuz you can't make any sense
    Of the ludicrous nonsense and incipient senescence
    That will deem your common sense useless

  4. #4
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447

    Exclamation Nothing to worry

    Actually, even in case of unicode, you don't have to think, since independently on an ASCII or unicode storage, the parameters Start and Length are NOT in bytes, but in characters. Please consult Microsoft for more information.
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

Posting Permissions

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