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语句,或其他编程实现的方法
如下:
----------
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语句,或其他编程实现的方法
楼主都已经知道该如何寻找的方法了,
好像只有 Lotus 等数据库不能用这种方法吧。
oracle: select column_name from user_tab_columns where table_name='TB_NAME';
oracle的表名必须大写才行。
Table "tapes"
Column | Type | Modifiers
----------+-----------------------+-----------
tape_id | character(8) | not null
title | character varying(80) | not null
duration | interval |