一、判断该数据库中该表是否存在
sqlserver:
select count(*) from SysObjects where XType='U' and name ='table'
XType='U' 可以不要
二、判断该数据库中的某个字段是否存在
sqlserver:
select count(1) from syscolumns where id=object_id('表名') and name='字段名'
oracle:
select count(column_name) from cols where table_name = upper('表名') and column_name = upper('字段名')