Home > Database > Mysql Tutorial > 在新建数据库的时候判断要建的数据库是否存在

在新建数据库的时候判断要建的数据库是否存在

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 14:53:44
Original
2639 people have browsed it

在新建数据库的时候判断要建的数据库是否存在 if(exists( select * from sys.databases where name=数据库名)) begin www.2cto.com print 存在 end else begin print 不存在 end


在新建数据库的时候判断要建的数据库是否存在

 

 if(exists( select * from sys.databases where name='数据库名'))

 begin     www.2cto.com  

   print '存在'

 end 

 else

 begin

   print '不存在'

 end
 

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