home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.sybase
- Path: sparky!uunet!caen!spencer
- From: spencer@med.umich.edu (Spencer W. Thomas)
- Subject: systypes?
- Message-ID: <SPENCER.92Nov19171743@guraldi.med.umich.edu>
- Date: Thu, 19 Nov 92 17:17:43 EST
- Organization: University of Michigan
- Distribution: comp
- Nntp-Posting-Host: guraldi.itn.med.umich.edu
- Lines: 21
-
- What's the SQL to map a user type to the corresponding system type? I
- thought I had it. I'm using this SQL to try to extract column name,
- system type, and length.
-
- select c.name,v.name,c.length \
- from syscolumns c,sysobjects o,master.dbo.spt_values v \
- where c.id=o.id and o.name="table" and c.type=v.low and\
- v.type="J"
-
- Works fine, except that not all system types are in the
- master.dbo.spt_values table. Mine is missing image, sysname, text,
- and timestamp. Another DB I checked is also missing smalldatetime,
- smallmoney, and real.
-
- An observation I've made is that the "usertype" for all system types
- is <100. Can I count on this?
-
- --
- =Spencer W. Thomas | Info Tech and Networking, B1911 CFOB, 0704
- "Genome Informatician" | Univ of Michigan, Ann Arbor, MI 48109
- Spencer.W.Thomas@med.umich.edu | 313-747-2778, FAX 313-764-4133
-