Check for SQL server port mismatch Re: tsql -S works but tsql -H times out

"Morizono, Hiroki" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Thanks Eric--

Someone had turned on dynamic ports on the SQL server and didn't set it back so instead of having the server listening at 1433 like I thought. 

tsql -LH 123.123.123.123 showed the portnumber to be up in the 49000 range.

tsql -H 123.123.123.123\\instancename -p portnumber -U 

Things worked when instead of using 1433, I set it to the right number.
my freetds.conf 
only had

[shortname]
  host = 123.123.123.123
  instance = instance
  tds version = 8.0

and didn't have a port =  
in it. 

Am guessing that 
tsql -S shortname -U sa 
was talking to the SQL Server Browser which sent things to the correct dynamic port


For what it's worth
TDSVER=7.2 tsql -H 123.123.123.123\\instancename -p portnum -U username
on SQL Server 2008 Express 
will connect but first throws up the following error 
Error 100 (severity 11):
              unrecognized msgno
1>

Changing to
TDSVER=8.0 
fixes that.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.