MySQL和sqlserver中判断表是否存在语句

2014-11-24 14:16:04 · 作者: · 浏览: 0
MySQL和sqlserver中判断表是否存在语句
MySQL:
   SELECT COUNT(*) FROM information_schema.
   TABLES WHERE TABLE_NAME="表名";

// 是双引号
值为1 表示存在该表; 为0 不存在表。
sqlserver:
    select 1 from sysobjects where name='表名' ;

值为1 表示存在表, 为null 不存在表。