Check sysobjects and syscolumns tables.
Here is a diagram of Sybase system tables.
List of all user tables:
SELECT * FROM sysobjects WHERE type = 'U'
You can change 'U' to other objects:
- C – computed column
- D – default
- F – SQLJ function
- L – log
- N – partition condition
- P – Transact-SQL or SQLJ procedure
- PR – prepare objects (created by Dynamic SQL)
- R – rule
- RI – referential constraint
- S – system table
- TR – trigger
- U – user table
- V – view
- XP – extended stored procedure
List of columns in a table:
SELECT sc.*
FROM syscolumns sc
INNER JOIN sysobjects so ON sc.id = so.id
WHERE so.name = 'my_table_name'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…