Procedure will check if schema with the given name exists in the database, and if there are any objects associated with this schema, and will attempt to drop it.

Arguments

  • v_Object_Name – Schema Name, SYSNAME
  • v_Database_Name – Name of the target database where schema should be removed, NVARCHAR(128).
    NULL is the default parameter. When null is specified then schema will be removed in the current context.

 

Examples

SQL Server

      EXECUTE DBTD_DROP_SCHEMA_IF_EXISTS 'INTERFACE';

      EXECUTE DBTD_DROP_SCHEMA_IF_EXISTS 'MySchema', NULL;

      EXECUTE DBTD_DROP_SCHEMA_IF_EXISTS 'MySchema', 'SomeonesDatabase';
 

See Also