Results 1 to 6 of 6

Thread: [RESOLVED] preposterous 8000 limit in SQLServer fields

  1. #1

    Thread Starter
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Resolved [RESOLVED] preposterous 8000 limit in SQLServer fields

    Hi all,

    Now first of all, I know there's lots of forum posts on this topic, however, so far all I seem to find are workarounds to the 8000 varchar limit problem. That's not what i'm looking for, I would like to do this properly and so I would like to know some information about this to which I can't seem to find on any of Microsofts resources.

    Ok so actually it's not varchar that I'm using, but the 8000 limit seems to apply to any field type, I'm using a binary field but I need to know it can store more than 8000. Now Microsoft itself says the size limit of a field is something like 2.1 billion bytes (same as every other database I've used).. yet when I try to create a field, it limits me to 8000, now I'm using express edition... and what I would like to know is..

    does this same limit apply to Standard and Enterprise editions?

    (I know there is a TOTAL 4gb limit on express, but there doesn't seem to be mention of field size)
    So if anyone has Standard or Enterprise and could be kind enough to test making a field larger than 8000(or have done it before), please could you let me know?

    If the paid for editions support the proper 2.1billion or so size, then I'll simply get hold of a copy of those. If not, I'll either mess around with multiple records in SQLServer or just ditch it for another engine.

    Thanks for your time

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,347

    Re: preposterous 8000 limit in SQLServer fields

    If you're using varchar, varbinary or the like then you can specify the width of the field up to 8000 bytes (so 4000 characters for nvarchar) or else you can specify 'max'. Data that goes beyond the 8000 byte limit is stored external to the record itself for efficiency, hence the differentiation.

  3. #3

    Thread Starter
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: preposterous 8000 limit in SQLServer fields

    Quote Originally Posted by jmcilhinney View Post
    If you're using varchar, varbinary or the like then you can specify the width of the field up to 8000 bytes (so 4000 characters for nvarchar) or else you can specify 'max'. Data that goes beyond the 8000 byte limit is stored external to the record itself for efficiency, hence the differentiation.
    Thanks jm,

    you're always full of useful knowledge!

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,347

    Re: preposterous 8000 limit in SQLServer fields

    Quote Originally Posted by Phill64 View Post
    Thanks jm,

    you're always full of useful knowledge!
    Full of something, that's for sure.

  5. #5
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: [RESOLVED] preposterous 8000 limit in SQLServer fields


  6. #6
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: [RESOLVED] preposterous 8000 limit in SQLServer fields

    Don't ignore leinad31's link - it's got good info.

    The 8000 byte limit is related to physical disk i/o of the sql engine - basically that's the max page size.

    It's probably best to put a field with your varbinary(max) datatype into a table with very few columns - even if it's related to the PK of another table - resist putting a field like this into that table. Put it in a related sister table with the same PK.

    We store photos of kids in a school district in a StuPhoto_T table that has just the PK of the student id and the single other field of the photo's binary data (actually we store the original filename and the size in bytes of the binary field as well)

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

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