XLeratorDB/util Online Documentation
DatabaseExists
Updated: 30 October 2008
Use wct.DatabaseExists to determine if the specified database exists in the server.
Syntax
SELECT [westclintech].[wct].[DatabaseExists](
<@DatabaseName, nvarchar(4000),>)
Arguments
@DatabaseName
is the name of database being tested for. @DatabaseName is an expression of the character string data type category.
Return Types
bit
Remarks
· DatabaseExists simplifies SQL intended to drop a database if it exists.
Example
IF (wct.DatabaseExists('myDatabase') <> 0) DROP DATABASE myDatabase
Here is the result set
----------------------
Command(s) completed successfully