I have access to command line isql and I like to get Meta-Data of all the tables of a given database, possibly in a formatted file. How I can achieve that?
Thanks.
I have access to command line isql and I like to get Meta-Data of all the tables of a given database, possibly in a formatted file. How I can achieve that?
Thanks.
sp_help
is what you're looking for.From Sybase online documentation on the sp_help system procedure:
Here is the (partial) output for the publishers table (pasted from Using sp_help on database objects):
Still quoting Using sp_help on database objects:
Check sysobjects and syscolumns tables.
Here is a diagram of Sybase system tables.
List of all user tables:
You can change 'U' to other objects:
List of columns in a table:
If Sybase is SQL-92 compliant then this information is stored within the INFORMATION_SCHEMA tables.
So the following will give you a list of tables and views in any SQL-92 compliant database
Here a different approach to get meta data. This very helpful SQL command returns you the table / view definition as text:
SELECT text FROM syscomments WHERE id = OBJECT_ID('MySchema.MyTable') ORDER BY number, colid2, colid
Enjoy Patrick
sp_tables
will also work in isql. It gives you the list of tables in the current database.