4000 character limit

  • Hi Guys,

    I have a cms'd website that uses a sql2000 database to store all the pages' content in a table. The data type on the column with the page text in it is set to ntext but has a limit of 4000 characters. I have tried text and varchar(8000) as well, but that still seems to have a limit of 4000. With varchar(8000) it seems to work, but once there is more than 4000 character being inserted, some of the characters at the end turn into strange symbols:ermm: Sort of like a diamond shape with a question mark in.

    Does anyone know how i could solve this problem?

  • ntext has a limit of 2GB. If the string is getting trimmed at 4000 characters, then it has something to do with how you're putting the data in or how you're querying it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Ok well the site was done in PHP with an ODBC DSN that points to the DB. Could it be that?

  • Dunno. Depends on how the query's done in php.

    If you run a profiler trace against the server, what are the command you see been run against the SQL server when inserting that column and when querying it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • a profile trace? whats that?

    i think i found the problem.. it was an odbc setting that was limiting the trasactions to 4096 bytes. i changed that and it seems to work now.

  • jacques (11/27/2008)


    a profile trace? whats that?

    SQL Server Profiler. It's a tool that can trace events occurring on a SQL Server.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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