1.oracle

 sql   = "SELECT column_name, data_type, data_length, nullable";

 sql += " FROM user_tab_columns ";

 sql += " where table_name='";

 sql += $tableName;

 sql += "'";

2.sql server

 sql   = "select  name,xtype,length,isnullable  from  syscolumns where id =";

 sql += " (select  top 1 Id   from  sysobjects  where name = '";

 sql += $tableName;

 sql += "')";

3.my sql

 sql   = "show columns from ";

 sql += $tableName;

 sql   = "desc ";

 sql += $tableName;

 sql   = "describe ";

 sql += $tableName;

 

posted on 2008-10-15 13:43  Stym--闫生  阅读(811)  评论(1编辑  收藏  举报