From a Sybase Database, how I can get table descri

2019-01-16 05:52发布

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.

11条回答
等我变得足够好
2楼-- · 2019-01-16 06:16

If you want to use a command line program, but are not restricted to using SQL, you can use SchemaCrawler. SchemaCrawler is open source, and can produce files in plain text, CSV, or (X)HTML formats.

查看更多
小情绪 Triste *
3楼-- · 2019-01-16 06:18

You can search for column in all tables in database using:

SELECT so.name 
FROM sysobjects so
INNER JOIN syscolumns sc ON so.id = sc.id 
WHERE sc.name = 'YOUR_COLUMN_NAME'
查看更多
\"骚年 ilove
4楼-- · 2019-01-16 06:18

When finding user table, in case if want the table owner name also, you can use the following:

select su.name + '.' + so.name
from   sysobjects so,
       sysusers   su
where  so.type = 'U' and
       so.uid  = su.uid
order  by su.name,
          so.name
查看更多
Anthone
5楼-- · 2019-01-16 06:18

In the Sybase version I use, the following gives list of columns for selected table

select *
FROM sys.syscolumns sc
where tname = 'YOUR_TABLE_NAME'
--and creator='YOUR_USER_NAME' --if you want to further restrict tables
--according to the user name that created it
查看更多
放荡不羁爱自由
6楼-- · 2019-01-16 06:25

Sybase IQ:

describe table_name;
查看更多
登录 后发表回答