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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:31:35
Original
1228 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:
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
Latest Issues
Problem with tp6 connecting to sqlserver database
From 1970-01-01 08:00:00
0
0
0
Unable to connect to SQL Server in Laravel
From 1970-01-01 08:00:00
0
0
0
Methods of parsing MYD, MYI, and FRM files
From 1970-01-01 08:00:00
0
0
0
SQLSTATE: User login failed
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template