在新建数据库的时候判断要建的数据库是否存在
Jun 07, 2016 pm 02:53 PM在新建数据库的时候判断要建的数据库是否存在 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

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How does Go language implement the addition, deletion, modification and query operations of the database?

Detailed tutorial on establishing a database connection using MySQLi in PHP

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos

How does Hibernate implement polymorphic mapping?

How to determine whether a date is the previous day in Go language?

An in-depth analysis of how HTML reads the database

Analysis of the basic principles of MySQL database management system

Tips and practices for handling Chinese garbled characters in databases with PHP
