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.
You can use built-in procedure sp_columns. It will return all the table metadata including column name, data type, column length etc.
Use DESCRIBE TABLE to list all the columns in the specified table or view. The DESCRIBE TABLE statement returns one row per table column, containing: Column The name of the column. Type The type of data in the column.
In the Administration Console, expand IQ Servers > Schema Objects > Tables. Select Tables, Global Temporary Tables, or Proxy Tables. Select one or more tables from the right pane and either: Click the arrow to the right of the name and select Generate DDL, or.
So desc or describe command shows the structure of table which include name of the column, data-type of column and the nullability which means, that column can contain null values or not.
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:
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With