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;