SQL Server Views with large amount of characters truncated

[expired user #9391]'s profile image [expired user #9391] posted 9 years ago in General Permalink
Hi,

It seems that SQLServer views with a large amount of characters are also truncated and are limited to 4000 characters in the editor.
I have a big view with a lot of "union".
Even if it is working when I validate the view, when reading back the content, the body is truncated.
[expired user #9353]'s profile image [expired user #9353] posted 9 years ago Permalink
You need to increase the maximum size of a text column to be returned from SQL Server by PHP. You can do this with a simple SQL query:

SET TEXTSIZE 2147483647

Which you can run with the following PHP (best run just after you make a connection).

mssql_query("SET TEXTSIZE 2147483647");

A better way to work around the issue is to change the "textlimit" and "textsize" settings within php.ini, like so:

mssql.textlimit = 2147483647
mssql.textsize = 2147483647
[expired user #9391]'s profile image [expired user #9391] posted 9 years ago Permalink
Mmhhh. I don't speak about PHP ! But about heidisql editor window !
ansgar's profile image ansgar posted 9 years ago Permalink
Probably I can automatically fire that SET TEXTSIZE in HeidiSQL at startup. Makes sense, or?
[expired user #9259]'s profile image [expired user #9259] posted 9 years ago Permalink

Hi,

It seems that SQLServer views with a large amount of characters are also truncated and are limited to 4000 characters in the editor.
I have a big view with a lot of "union".
Even if it is working when I validate the view, when reading back the content, the body is truncated.



I have the same issue. The views are truncated after around 300 words or like 2000 characters. But it is not exactly after 300 words or 2000 characters.

Probably I can automatically fire that SET TEXTSIZE in HeidiSQL at startup. Makes sense, or?

Probably I can automatically fire that SET TEXTSIZE in HeidiSQL at startup. Makes sense, or?



I would like to try and see if that solves the problem. Could you explain more detailed how you would set the textsize in HeidiSQL startup?
Code modification/commit f3e6543 from ansgarbecker, 9 years ago, revision 9.3.0.5017
MSSQL: Set textsize to a large value, so the view editor does not load partial code only. See http://www.heidisql.com/forum.php?t=19779#p19981
ansgar's profile image ansgar posted 9 years ago Permalink
Just by firing a "SET TEXTSIZE 2147483647" query automatically on a MSSQL session.

r5017 does that. @fuchsyve, please update to the latest HeidiSQL build and report back if that works for you. For me it does, however.
[expired user #9259]'s profile image [expired user #9259] posted 9 years ago Permalink

Just by firing a "SET TEXTSIZE 2147483647" query automatically on a MSSQL session.

r5017 does that. @fuchsyve, please update to the latest HeidiSQL build and report back if that works for you. For me it does, however.



Since I got HeidiSQL updated to 5019 and the view is still truncated, this is sadly not the solution...

Any other ideas how to solve this?
[expired user #10055]'s profile image [expired user #10055] posted 8 years ago Permalink

I had the same issue but manually entering the SET TEXTSIZE solves it. Is there a way to automate this? In the current Version it doesn't seem to happen at Startup of the session.

Please login to leave a reply, or register at first.