MS SQL Server中的方法我已经知道了
如下:
----------
SELECT column_name,data_type,character_maximum_length,is_nullable 
FROM information_schema.columns 
WHERE (table_name = 'tablename')
----------
SELECT constraint_name,column_name
FROM information_schema.key_column_usage
WHERE (table_name = 'tablename')"
----------
我想知道在其他类型的数据库中该怎么做,得到类似的信息
方法:SQL语句,或其他编程实现的方法

解决方案 »

  1.   

    只要楼主弄个数据库来,一样的道理,一般都可以查出来。
    楼主都已经知道该如何寻找的方法了,
    好像只有 Lotus 等数据库不能用这种方法吧。
      

  2.   

    mysql:desc tb_name
    oracle: select column_name from user_tab_columns where table_name='TB_NAME';
    oracle的表名必须大写才行。
      

  3.   

    To see the detailed definition of a particular table, use the \d table-name meta-command:movies=# \d tapes
                    Table "tapes"
      Column  |         Type          | Modifiers
    ----------+-----------------------+-----------
     tape_id  | character(8)          | not null
     title    | character varying(80) | not null
     duration | interval              |