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