[SQL] Tabel eigenschappen weergeven

Pagina: 1
Acties:
  • 250 views sinds 30-01-2008
  • Reageer

  • emkedouwe
  • Registratie: September 2001
  • Laatst online: 26-11-2021
Wat is de SQL-statement om de eigenschappen van de tabel weer te geven?? dus veldnaam + type
bv:
naam varchar(30) NOT NULL

enz

HET GAAT OM EEN SYBASE DB

Verwijderd

http://gathering.tweakers.net/forum/find ... |:(

describe tabelnaam;

althans, voor mysql is dat

  • ACM
  • Registratie: Januari 2000
  • Niet online

ACM

Software Architect

Werkt hier

Er is geen _de_ statement voor, die kan per database verschillen...

  • emkedouwe
  • Registratie: September 2001
  • Laatst online: 26-11-2021
deze werkt niet onder sybase

Verwijderd

dan is het misschien handig om bij je vraag even te zetten dat het om sybase gaat :) (nofi)

  • ACM
  • Registratie: Januari 2000
  • Niet online

ACM

Software Architect

Werkt hier

in sybase is het toch 'desc tabelnaam;' ?

Maar dat staat echt wel in de documentatie.

  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 28-08 12:00

Janoz

Moderator Devschuur®

!litemod

Heb je al in de sybase handleiding gekeken?

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


  • emkedouwe
  • Registratie: September 2001
  • Laatst online: 26-11-2021
nee ik heb die nog niet gevonden, ik heb een algemeen SQL boek. Iemand mischien een linkje ?

  • Woudloper
  • Registratie: November 2001
  • Niet online

Woudloper

« - _ - »

Ik gebruik altijd zoiets:
code:
1
2
3
4
5
6
7
8
9
10
11
SELECT  SO.NAME             AS TABLENAME,
      SC.NAME               AS COLUMN,
      ST.NAME               AS TYPE,
      SC.LENGTH           AS LENGTH
FROM    SYSTYPES               AS ST,
      SYSCOLUMNS             AS SC,
      SYSOBJECTS             AS SO
WHERE   ST.USERTYPE = SC.USERTYPE    AND
      SO.ID = SC.ID         AND
      SO.ID > 10000         
ORDER BY SO.NAME;

Dit werkt wel op een SQL Server... Werkt geloof ik ook op Oracle...

Edit: Typo

  • ACM
  • Registratie: Januari 2000
  • Niet online

ACM

Software Architect

Werkt hier

Op dinsdag 18 juni 2002 13:37 schreef emkedouwe het volgende:
nee ik heb die nog niet gevonden, ik heb een algemeen SQL boek. Iemand mischien een linkje ?
Mja, dat is neit zo moeilijk te vinden.
manuals.sybase.com

Btw, daar staat iets als:
Getting information about tables
• sp_help displays information about tables, listing any attributes (such
as cache bindings) assigned to the specified table and its indexes,
giving the attribute’s class, name, integer value, character value, and
comments.
• sp_depends displays information about the view(s), trigger(s), and
procedure(s) in the database that depend on a table.
• sp_helpindex reports information about the indexes created on a table.
in http://download.sybase.com/pdfdocs/asg1250e/refman2.pdf
bij hoodstuk 4 over tables -> create tables -> getting information about tables.
Pagina: 1