Skip to Content.
Sympa Menu

freetds - Re: [freetds] Setting for returned column size in FreeTDS?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <james.k.lowden AT alliancebernstein.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Setting for returned column size in FreeTDS?
  • Date: Fri, 18 Aug 2006 11:46:13 -0400

> From: Ken Tozier
> Sent: Friday, August 18, 2006 9:44 AM
>
> On Aug 18, 2006, at 5:27 AM, Daniel Fazekas wrote:
>
> > On Aug 18, 2006, at 6:47, Ken Tozier wrote:
> >> I already set all copies on freetds.conf on our server to use
> >> [MyServer2k]
> >> host = <correct domain here>
> >> port = 1433
> >> tds version = 8.0
> >
> > Have you confirmed that you are calling php's connection function,
> > eg. mssql_connect(), with 'MyServer2k' as the first parameter?
> > If not, your settings here are just being ignored as something
> > which only applies to another server.
>
> I wasn't using symbolic name,'MyServer2k' I was using the actual
> host url. Will test, thanks

Ah, that's the problem then. Maybe FreeTDS should come with a warning
label: "Use as directed". ;-)

FreeTDS looks up the name you provide in its configuration files,
starting with freetds.conf. It looks it up by what the documentation
calls the "dataserver" name e.g. 'MyServer2k', above. If you provide a
hostname instead, that's considered an error.

In the event the provided name is not found, the library will attempt to
make the connection anyway using DNS name resolution or, in a last
desperate attempt, it will try to convert it to an ip address. At that
point, though, it's no longer looking at your configuration files; any
connection made that way will rely on built-in defaults or environment
variables.

You can prove this all to yourself using tsql. Try:

$ TDSDUMPCONFIG=stdout tsql -S dataserver -Ux -Px

and compare with

$ TDSDUMPCONFIG=stdout tsql -S hostname -Ux -Px

In the first case you should see something like this:

config.c:393:Got a match.
config.c:413:option = 'host' value = '<correct domain here>'.
config.c:440:Found host entry <correct domain here>.
config.c:443:IP addr is <correct address here>.
config.c:413:option = 'port' value = '1433'.
config.c:413:option = 'tds version' value = '8.0'.

In the second case you won't see that and are likely to see something
like:

config.c:974:Setting 'ip_port' to 1433 as a guess.

instead.

HTH.

--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.




Archive powered by MHonArc 2.6.24.

Top of Page