Seems to me I tried this, but I could have had another problem, I'll give it
another try, thanks,

It's really great working with all this help available, double thanks,

Warren Vail
Tools, Metrics & Quality Processes

-----Original Message-----
From: Marco Tabini [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 10, 2002 2:01 PM
To: Vail, Warren
Cc: PHP-General
Subject: Re: [PHP] MS SQL server TEXT column

Set TEXTSIZE usually does it for me:

mssql_connect ($conn, $user, $pwd);
mssql_select_db ($db);
mssql_query ('Set TEXTSIZE 2147483647');

mssql_query ('Select text_column from table where Id = 1');

Make sure that you select a database first and that the connection is
not closed between your Set TEXTSIZE op and the actual query. If you are
not specifying a connection in you mssql_query statement, make sure that
you haven't opened a different connection between Set TEXTSIZE and your
actual query--PHP uses the most recently opened connection as a default,
and if you open a new connection between the two queries, the second
connection will not have the TEXTSIZE set. Hope that helps.


On Thu, 2002-10-10 at 17:04, Vail, Warren wrote:
> Encountered the following problem with the Microsoft SQL Server interface.
> I am not sure where the problem exists, but I am looking for a workaround.
> I inserted a row into a table that contained a text column, and inserted
> over 5kb string into the text field.  On retrieving the row the server
> returned the column values truncated to 4096 bytes exactly.  Tried to code
> SET TEXTSIZE nnn into my query string, the query refused to return
> at all.  Then I tried coding SET TEXTSIZE as a separate query on the same
> connection, just prior to my data query, both appeared to be successful,
> still only got 4096 bytes of data.
> select DATALENGTH(availabilitySample) from mftsmainframeavailability where
> availabilityID = 1
> using the MSSQL 7 Query analyzer returns;
> ----------- 
> 5242
> (1 row(s) affected)
> This shows that my text was stored, I just can't seem to get the server
> the interface) to give me back more than 4096 bytes.
> any clues would be greatly appreciated.
> thanks in advance,
> Warren Vail
> Tools, Metrics & Quality Processes
> -- 
> PHP General Mailing List (
> To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to