饼 饼干 Unregistered / Unconfirmed GUEST, unregistred user! 2008-03-21 #1 怎么判断数据库表中是否有某个字段???? 假如在A表中有一个aa字段,怎么样才能判断出有还是没有这个aa字段呢?
L ly810916 Unregistered / Unconfirmed GUEST, unregistred user! 2008-03-21 #2 从系统表中查找,在sysobjects表中查到对象的id,根据id到syscolumns中查找字段。比如你要找到一个test表的所有字段名: select name from syscolumns where id in(select id from sysobjects where name='test') 只对sql server
从系统表中查找,在sysobjects表中查到对象的id,根据id到syscolumns中查找字段。比如你要找到一个test表的所有字段名: select name from syscolumns where id in(select id from sysobjects where name='test') 只对sql server
贝 贝尔 Unregistered / Unconfirmed GUEST, unregistred user! 2008-03-24 #5 query.close; query.sql.clear; query.sql.add('select name from 表'); query.open; if not query.eof then