Home  >  Article  >  Database  >  MySQL和sqlserver中判断表是否存在语句_MySQL

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

WBOY
WBOYOriginal
2016-06-01 13:31:351143browse

bitsCN.com

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

 

MySQL:

   SELECT COUNT(*) FROM information_schema.   TABLES WHERE TABLE_NAME="表名";

 

 // 是双引号

 

值为1 表示存在该表; 为0 不存在表。

 

sqlserver:

 

    select 1 from sysobjects where name='表名' ;

 

 

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

 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn