1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Text or large varchar fields in SQL server

Discussion in 'C#' started by pseudomorph, Aug 16, 2006.

  1. #1
    I have read that there can be a periodic problem when reading large varchar or text fields from SQL server (or memo fields from Access)--they can sometimes come up as empty strings. (See http://www.aspfaq.com/show.asp?id=2188.)

    What I have been unable to find out is whether this problem is still around in recent versions of MDAC (>= 2.8). Does anyone know whether this problem still occurs--is it still necessary to follow the steps in that aspfaq article?
    SEMrush
     
    pseudomorph, Aug 16, 2006 IP
    SEMrush
  2. Carlito

    Carlito Peon

    Messages:
    679
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I work with SQL DBs all day long everyday and I've never seen that problem.
     
    Carlito, Aug 16, 2006 IP
  3. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #3
    That problem occurs when you have an online admin panel for your client, you use DBs and you client is inserting more than 8000 chars into the text filed, he doesn't care whether the DB supports 8000 chars or 8000.5 chars, he needs his content in the DB, completely

    I had a client whom we gave a permission of 80,000 but even that was not enough for him :confused:
    What he did was creating the file in MS Word, saving it as a webpage and then viewing the source and copy/pasting it into the text filed.
    He had like 105,000 chars in one text area

    So the case that Carlito is using less than 8000 chars is not for this topic :)
    Dude, you may face this problem some day, I mean you will
     
    ludwig, Aug 16, 2006 IP
  4. pseudomorph

    pseudomorph Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I thought that if you try to insert more than ~8000 characters in a row, the user would just get an error. I'm interested in the case when data has been written to the database and then it is being retrieved in ASP code; I'm told that sometimes fields retrieved using rs("fieldname") syntax can come up as empty (apparently, sometimes it will show up the first time I call rs("fieldname"), but as an empty string on subsequent times). I'm asking because I have never run into the problem but I need to ensure that I won't. I have code that violates the suggestions set forth in that ASPFAQ article I linked to above, and I want to know if it needs to be rewritten if I'm using a recent version of MDAC.
     
    pseudomorph, Aug 16, 2006 IP
  5. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,607
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #5
    if it HAS to be bigger than 8K chars - then use the Text datatype. Only issue with this is you can't retrieve the data when it gets to large in EM and sorting this datatype is not an option.
     
    ccoonen, Aug 17, 2006 IP