1、Sqlite 数据库:
select count(*) from sqlite_master where type='table' and name='TableName'
sqlite_master 是 sqlite维护的系统表
2、SqlServer2000数据库
if exists(select 1 from sysobjects where name='TableName' and xtype='u')
print '存在'
else
print '不存在'
3、SqlServer2005数据库
SELECT ISNULL(OBJECTPROPERTY(OBJECT_ID('TableName'), 'IsUserTable'), 0)
存储过程中判断方法:
IF OBJECT_ID ('TableName', 'U') IS NOT NULL