Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-01 13:31:35
Original
1184 people have browsed it

bitsCN.com

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

 

MySQL:

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

// 是双引号

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

sqlserver:

    select 1 from sysobjects where name='表名' ;
Copy after login

 

 

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

 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!