More on using FreeTDS on a server (was Re: [freetds] Server dumps core...)

James K. Lowden jklowden at schemamania.org
Sun Apr 18 04:07:54 EDT 2004


On Sat, 17 Apr 2004, Steve Kirkendall <skirkendall at dsl-only.net> wrote:
> 
> * Can anybody recommend an alternative ODBC/TDS driver for Windows?  

The FreeTDS ODBC driver can be built with VC++.  One big advantage that
would have (for you) would be that the TDSDUMP log file could show you the
packets being exchanged.  If you set the protocol to 4.2, it will also
capture the login packet.  Be advised that 4.2/5.0 login packet is very
different from the 7.0 one.  

You also might want windump.  http://windump.polito.it/

> * What should I do about queries that don't result in tables?  For
> example,
>   tsql sends a "set textsize 64512" request.  My server currently just
>   sends token #253 (Result Set Done).  Is that proper?

Do you have access to real server?  You can log sessions with it while
using tsql to see what packets are going back and forth.  E.g.

03:42:38.380762 tds_put_string converting 15 bytes of "set nocount on
"
03:42:38.380795 tds_put_string wrote 30 bytes
Sending packet @ 03:42:38.380817
0000 01 01 00 26 00 00 01 00-73 00 65 00 74 00 20 00 |...&.... s.e.t. .|
0010 6e 00 6f 00 63 00 6f 00-75 00 6e 00 74 00 20 00 |n.o.c.o. u.n.t. .|
0020 6f 00 6e 00 0a 00      -                        |o.n...|

Received header @ 03:42:38.921674
0000 04 01 00 11 00 00 00 00-                        |........|

Received packet @ 03:42:38.921743
0000 fd 00 00 b9 00 00 00 00-00                      |........ .|

03:42:38.921787 processing result tokens.  marker is  fd(DONE)
03:42:38.921811 tds_process_end: more_results = 0
03:42:38.921828                  was_cancelled = 0
03:42:38.921844                  error = 0
03:42:38.921860                  done_count_valid = 0

So, yeah,  253 looks copasetic.  ;-)

> * Can anybody spot any obvious problems with my table-sending function,
>   below?  

Nothing obvious, no.  I can tell you there's nothing magical about
integers, except of course for endianism.  

Looks like you're making progess, Steve.  HTH.

Regards, 

--jkl



More information about the FreeTDS mailing list