[freetds] Setting for returned column size in FreeTDS?

Ken Tozier kentozier at comcast.net
Thu Aug 17 18:11:28 EDT 2006


Well I checked into this today and although I wasn't able to solve  
the 255 character limit, I did discover that it only exists when  
retrieving data from MSSQL. I can write large strings without problem  
(Verified by looking at the database with Query Analyzer)

I don't know whether this is a FreeTDS issue or a MSSQL one but if it  
sounds like a FreeTDS issue, what other steps would you recommend?

The actual usage scenario goes like this
1. Mac OS X application sends a request to a PHP script.
2. PHP script packages up the request into an SQL query and sends it  
off to MSSQL
3a. If the request was an insert, it completes successfully  
regardless of data length
3b. If the request is a select, I get back the full contents of  
fields shorter than 255 characters but all fields 256 characters or  
longer get truncated to 255

Of note is that all queries, both insert and select, work as expected  
with MySQL so it's not a problem with the SQL (I do make the  
necessary query syntax changes for MSSQL)

Thanks

Ken





On Aug 15, 2006, at 10:59 AM, Lowden, James K wrote:

>> From: Ken Tozier
>> Sent: Tuesday, August 15, 2006 1:03 AM
>>
>> On Aug 15, 2006, at 12:25 AM, James K. Lowden wrote:
>>> "tsql -C" tells you the compiled-in default.  Usually that's
>>> overridden by something in freetds.conf.  The TDSVER environment
>>> variable overrides those.  You can check with the TDSDUMP variable;
>>> the top of the log shows the protocol version.
>>
>> I'd like to keep this as easy as possible for future maintainers.
>> If I never explicitly set the TDSVER environment variable, that
>> means it doesn't exist, correct? The build stage wouldn't have
>> created this variable for me, right? So if I understand correctly,
>> the next place it looks is the .conf file and lastly the compiled
>> in version, correct?
>
> Correct.  Environment variables are per-session; you can see them with
> the "env" command.  "Permanent" ones are created by the shell when  
> it's
> started by reading one of its startup files e.g. "${HOME}/.profile".
> Installing FreeTDS doesn't affect anything like that.
>
>> When I ran tsql -C I got this:
>>
>> Compile-time settings (established with the "configure" script):
>>                          Version: freetds v0.63
>>   MS db-lib source compatibility: no
>>      Sybase binary compatibility: unknown
>>                    Thread safety: yes
>>                    iconv library: yes
>>                      TDS version: 5.0
>>                            iODBC: yes
>>                         unixodbc: no
>
> OK, so 5.0 is your default.
>
>> This is my home development setup though so I'll have to check the
>> real thing tomorrow. Basically, for SQL 2003 I'll want to uncomment
>>
>> # A typical Microsoft SQL Server 2000 configuration
>> ;[MyServer2k]
>> ;	host = ntmachine.domain.com
>> ;	port = 1433
>> ;	tds version = 8.0
>>
>> and that should fix the 255 char limit problem?
>
> Basically, yes.  Of course you'll want to set the host correctly and
> probably rename [MyServer2k].
>
> There can be more than one freetds.conf.  You can set the  
> TDSDUMPCONFIG
> variable to display which ones it looks at when it's invoked.  "export
> TDSDUMPCONFIG=stdout" might be useful.
>
> Regards,
>
> --jkl
>
>
>
> -----------------------------------------
> The information contained in this transmission may be privileged and
> confidential and is intended only for the use of the person(s) named
> above. If you are not the intended recipient, or an employee or  
> agent responsible
> for delivering this message to the intended recipient, any review,  
> dissemination,
> distribution or duplication of this communication is strictly  
> prohibited. If you are
> not the intended recipient, please contact the sender immediately  
> by reply e-mail
> and destroy all copies of the original message. Please note that we  
> do not accept
> account orders and/or instructions by e-mail, and therefore will  
> not be responsible
> for carrying out such orders and/or instructions.  If you, as the  
> intended recipient
> of this message, the purpose of which is to inform and update our  
> clients, prospects
> and consultants of developments relating to our services and  
> products, would not
> like to receive further e-mail correspondence from the sender,  
> please "reply" to the
> sender indicating your wishes.  In the U.S.: 1345 Avenue of the  
> Americas, New York,
> NY 10105.
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds




More information about the FreeTDS mailing list