Closed Thread
Results 1 to 2 of 2

Thread: SQL Server 2008: String or binary data would be truncated

  1. #1
    Keith is offline Newbie
    Join Date
    Nov 2009
    Posts
    9
    Rep Power
    0

    SQL Server 2008: String or binary data would be truncated

    Hello again.

    I'm about to pull my whole hair with this one...
    My database has a table Articles (news). So, one of the fields is obviously the text from that article. I defined it as TEXT data type.

    This error: "String or binary data would be truncated." appears every time I try to add text to that field on a existing record.

    And somehow this is causing me one other problem. Everytime I try to get this text on a PHP page, the text was cut (more than half of it).

    I've been doing some reading, and the Text field supports up to 2.000.000 characters. I don't intend to use more than 12.000 per record. But it seems that no other data type can support as many as Text.


    Am I doing something wrong?
    Please help me,

    Thanks

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Keith is offline Newbie
    Join Date
    Nov 2009
    Posts
    9
    Rep Power
    0

    Re: SQL Server 2008: String or binary data would be truncated

    Solved my problem.
    It's not MSSQL related, but PHP.
    By default, the maximum data PHP can get is 4096 (2^12) characters.

    What you need to do: edit the php.ini file.

    Code:
    mssql.textlimit = 1048576
    
    mssql.textsize = 1048576
    1048576 = 2^20, so that should be enough for. If not, increase the values above.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problems with Microsoft SQL Server 2008
    By DoktorD1313 in forum Database & Database Programming
    Replies: 3
    Last Post: 07-13-2011, 02:28 PM
  2. Replies: 6
    Last Post: 12-27-2010, 12:13 PM
  3. string will not appear in label vb.net 2008
    By theBIGmac666 in forum Visual Basic Programming
    Replies: 3
    Last Post: 12-26-2010, 09:59 PM
  4. Binary Data
    By John in forum C and C++
    Replies: 8
    Last Post: 11-25-2009, 08:54 AM
  5. Management Studio 2008 with SQL Server 2008 is not working?
    By ArekBulski in forum Database & Database Programming
    Replies: 3
    Last Post: 09-04-2009, 02:16 AM

Tags for this Thread

Bookmarks

Posting Permissions

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