VarChar(8000) with inserts

  • Varchar(8000) is the limit or nearly so for characters, but with my insert attempts, some had to be trimmed off. The test data were three record, each with exactly 8000 ASCII characters. When another column was added to the table, the same VarChar(8000) column would actually accept a even fewer characters. While it was nearly 8000 characters, the fluxuation is quirky, and difficult to plan on. Incidentally, converting to Text data type allowed all 8000 characters, but I'd like the option to use the VarChar data type. Has anyone had any experience with this?

  • I've had similar experiences. I wound up deciding to make it a habit to not push the limit, and restrict myself to using varchar(7980), as that seems to be the topmost value that has never given me issues.

  • That is a great article but keep in mind there are all kinds of data in the actual storage, especially when involving varchars that help the server find the start and end of the data. This overhead eats into the actually row length. I haven't tested but I am curious how many short varchar columns you can add with actual data before the pointer data overtakes the size.

  • Interesting, but did you ever consider a blob. The reason, when I did a migration to Oracle9i, there were fields that were VARCHAR5000, however when I ran into or push to Oracle it isolated to a CLOB field instead since Oracle's varchar limit is VARCHAR2 4000. I had to restructure the datatype. Just letting you know.

    Thanks

    JMC


    JMC

  • To ensure reliability, we're just using the Text data type.

    On the subject of BLOBs, I recently tried to convert a flat file, which is full of control codes and non-printable ASCII, to a BLOB. I'm having trouble. Direct assignment to the Image field crashes on apostrophies and, while the gymnastics of writing a file to use the stream recordset object apparently works, the jury is still out about the goodness of the data upon retrieval. It's not as easy to tell as is looking at a picture. Are there any tried and true methods to put non-images into and retrieve them out of an Image data-type field?

  • We have a DB using the Image data type to store general data. Basically data extracted from the MF that is then published to various other non MF systems.

    Everything works well.

    There is one problem on SQL7, these rows are being added and deleted at the rate of about 350k per night. On SQL7 the shrinkfile fails periodicaly and increases the DB size. We have not had the problem with SQL2k, MS has confirmed this as a bug. Not MSKB 308627 which says to run SP4, which we are.

    KlK, MCSE


    KlK

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply