查询表是否存在:
表名:“BookHotelInfo”, type = 'u'
select * from sysobjects where id = object_id('BookHotelInfo') and type = 'u'
select * from sys.tables where name='BookHotelInfo' and type = 'u'
查询字段是否存在:
表名:“BookHotelInfo”, 字段名“RoomType”
select * from syscolumns where name='RoomType' and objectproperty(id,'IsUserTable')=1 and object_name(id)='BookHotelInfo'
Oracle查询表是否存在:
select count(*) from tabs where table_name ='表名' 返回一个数字 , 0 或者 1 ;