More on using FreeTDS on a server (was Re: [freetds]Serverdumpscore...)
mcbp223 at yahoo.com
Sun Apr 25 21:43:58 EDT 2004
> -----Original Message-----
> From: freetds-bounces at lists.ibiblio.org
> [mailto:freetds-bounces at lists.ibiblio.org]On Behalf Of Steve Kirkendall
> Sent: Sunday, April 25, 2004 3:51 PM
> To: FreeTDS Development Group
> Subject: Re: More on using FreeTDS on a server (was Re:
> > - system tables (syscomments and others)
> > - prepared statement (server side)
> > - some internal store procedure (sp_prepare, sp_tables, sp_typeinfo...)
> These could be a pain. That's my biggest worry right now. My hope is
> that, since this is a read-only database, I can ignore most of it.
If you know of any open source project that implements some of those tables,
like sysdatabases, sysobjectcache and such, and the cursor stored
procedures, I am interested.
> I'm finally receiving some queries from the Windows SQL Server ODBC
> driver, and some of them look rather strange. My favorite so far is
> "select 501,NULL,1 where 'a'='A'". What's that supposed to do?
> I didn't even know you could have a SELECT statement without a FROM
> clause. Should it use an implied table with 0 rows? 1 row? An
> infinite number of rows? And what should the column names be?
Here the driver asks if you compare case-sensitive or not. If your answer is
zero rows, you're case-sensitive; if it is one row, you're case-insensitive.
Just run those queries against a real SQL server to see how it behaves. The
column names are empty for this kind of query, since there's no column alias
> Sending packet @ 16:08:24.277520
> 0000 04 01 00 67 00 00 00 00-ee 2b 00 03 00 04 73 69 |...g.... .+....si|
> 0010 7a 65 30 00 00 00 00 2f-07 00 04 64 65 73 63 30 |ze0..../ ...desc0|
> 0020 00 00 00 00 2f 19 00 06-66 69 6c 6c 65 72 30 00 |..../... filler0.|
Here you send 0xEE which is TDS_ROWFMT, available in TDS 5.0. For TDS 4.2
you should send:
- 0xA0 column names
- 0xA1 column formats
- 0xD1 row 1
- 0xD1 row 2
- 0xFD done
More information about the FreeTDS