Re: Finding data type for a column

From: Scott Cook <Scott.Cook_at_ska.com>
Date: 1996/10/24
Message-ID: <326FC62E.65E9_at_ska.com>#1/1


Jedi wrote:
>
> Hi,
> I am trying to find out the data type of an column from within my
> applicaton.
> What is the ODBC or SQL statment to do that? For example, I have a table
> called
> Students and I want to know what data type the column name Address
> belongs to.

You need to go into the sys..... tables in your database. This is from MS SQL Server. It should
get you going on the right track.

select t.name
from sysobjects o, syscolumns c, systypes t, sysindexes i, syscolumns c1 where o.name = _at_table and o.type = 'U' and c.id = o.id and t.usertype = c.usertype and o.id = i.id
and (i.status & 0x800) = 0x800 and c.name = index_col (_at_table, i.indid, c1.colid)
and c1.colid <= i.keycnt and c1.id = _at_table_id order by c1.colid Received on Thu Oct 24 1996 - 00:00:00 CEST

Original text of this message