home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / sybase / 366 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.2 KB  |  33 lines

  1. Newsgroups: comp.databases.sybase
  2. Path: sparky!uunet!caen!spencer
  3. From: spencer@med.umich.edu (Spencer W. Thomas)
  4. Subject: systypes?
  5. Message-ID: <SPENCER.92Nov19171743@guraldi.med.umich.edu>
  6. Date: Thu, 19 Nov 92 17:17:43 EST
  7. Organization: University of Michigan
  8. Distribution: comp
  9. Nntp-Posting-Host: guraldi.itn.med.umich.edu
  10. Lines: 21
  11.  
  12. What's the SQL to map a user type to the corresponding system type?  I
  13. thought I had it.  I'm using this SQL to try to extract column name,
  14. system type, and length. 
  15.  
  16. select c.name,v.name,c.length \
  17.           from syscolumns c,sysobjects o,master.dbo.spt_values v \
  18.           where c.id=o.id and o.name="table" and c.type=v.low and\
  19.             v.type="J"
  20.  
  21. Works fine, except that not all system types are in the
  22. master.dbo.spt_values table.  Mine is missing image, sysname, text,
  23. and timestamp.  Another DB I checked is also missing smalldatetime, 
  24. smallmoney, and real.
  25.  
  26. An observation I've made is that the "usertype" for all system types
  27. is <100.  Can I count on this?
  28.  
  29. --
  30. =Spencer W. Thomas         |  Info Tech and Networking, B1911 CFOB, 0704
  31.    "Genome Informatician"    |  Univ of Michigan, Ann Arbor, MI 48109
  32. Spencer.W.Thomas@med.umich.edu    |  313-747-2778, FAX 313-764-4133
  33.