Skip to Content.
Sympa Menu

freetds - [freetds] The Mystery of sysstat2

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] The Mystery of sysstat2
  • Date: Mon, 18 Dec 2006 22:50:01 -0500

If you've ever wanted to contribute to FreeTDS but C wasn't your cup of
tea, your ship has come in. I could use a little detective work, and the
answer might at least partly exist in your database. Specifically, in
your sysobjects table.

The question is: what is the meaning of sysobjects.sysstat2 on Sybase? In
particular, what does it tell us about how bits are packed in a bcp row
image? We know Sybase uses this column to determine the packing of BIT
columns, but we don't know what the number means.

Now, I suppose we could call up Sybase and ask, but that might require
more social engineering skills than I've got, so I thought a little
sampling might be in order.

The question to you is: for tables having at least two BIT columns, what
value is in that tables's sysobjects.sysstat2?

I have the following so far:

[39] alex.FreeTDS.1> select count(*), min(cast(o.name as varchar(10))) as
tablename, o.sysstat2 from sysobjects o join syscolumns c on o.id = c.id
where c.type = 50 group by o.sysstat2
[39] alex.FreeTDS.2> go
tablename sysstat2
----------- ---------- -----------
2 systypes 0
10 bittypes1 73728 (0x00012000)
17 bittypes 74240 (0x00012200)

There appears to be some significance in 2nd LSB, 20 vs. 22.

If you have Sybase (not Microsoft) tables with other values for sysstat2,
and your tables have more than one BIT column, I'd like to know that value
and the associated DDL. You can use the defncopy utility that came with
your FreeTDS installation to make a nice script for me. Attach the output
and post it here. And thanks.

If you don't have anything unusual, please post the output of the above
query. If 10 people all have the same two numbers, that would give me
more confidence that a partial solution would be useful.

Regards,

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page