Hi all, when i retrieved data from MSSQL database, it was truncated into 4096 character instead of it's full length of data which is >80k char. How can i fix this? I use mssql_fetch_array() to retrieve the data. I've no problems inserting the data, but problems occurred during retrieving it.
Thanks in advance.
Data auto truncated by MSSQL
Moderator: General Moderators
Re: Data auto truncated by MSSQL
The size of the field is set to small, try increasing it.
I'm guessing its set manually, or tiny text/tiny blob.
Normal Text is roughly 60k, so Long Text/Blob should suffice.
I'm guessing its set manually, or tiny text/tiny blob.
Normal Text is roughly 60k, so Long Text/Blob should suffice.
Re: Data auto truncated by MSSQL
No, it was stored 80k characters in IMAGE data type, but when I retrieve it, it was truncated into 4093 chars only.
I've do the following setting:
in php.ini, i've set these two to
No problem when i insert the data(80k characters), just when i retrieve it using SELECT statement, the data was auto truncated to 4k characters. Anyone???
I've do the following setting:
in php.ini, i've set these two to
and in my code, i've run this as wellmssql.textsize = 2147483647
mssql.textlimit = 2147483647
Code: Select all
$sql = "SET TEXTSIZE 2147483647";
@mssql_query($sql, $conn); No problem when i insert the data(80k characters), just when i retrieve it using SELECT statement, the data was auto truncated to 4k characters. Anyone???
Re: Data auto truncated by MSSQL
You should be able to look at the Warnings, or errors log. It should be spitting out those when inserting the data. (But the data will still go in, just to the longest length allowed)
Side note, databases are the wrong place to store images. Images belong on the file system.
(I also just noticed this is MSSQL, not Mysql which is am familiar with, so this all could be iirrelevant.)
Side note, databases are the wrong place to store images. Images belong on the file system.
(I also just noticed this is MSSQL, not Mysql which is am familiar with, so this all could be iirrelevant.)
Re: Data auto truncated by MSSQL
You mention MSSQL which I have no experience with.
This should come in handy regardless: http://help.scibit.com/Mascon/masconMyS ... Types.html
They are more than likely somewhat similar to MSSQL.
This should come in handy regardless: http://help.scibit.com/Mascon/masconMyS ... Types.html
They are more than likely somewhat similar to MSSQL.
Re: Data auto truncated by MSSQL
Thanks everyone, I've finally solved that.
Actually the answer is where I mention in previous post
MSSQL information really lesser and more difficult to find compare to MYSQL, hope more people can share the knowledge.
Ciaos~
Actually the answer is where I mention in previous post
Somehow, don't know why it can't work if modify it in php.ini. After changing to use ini_set(_above_mention_) in the script, it only works like a charm. Thanks all.mssql.textsize = 2147483647
mssql.textlimit = 2147483647
MSSQL information really lesser and more difficult to find compare to MYSQL, hope more people can share the knowledge.
Ciaos~