ERWIN create and use database
You have to edit the Forward Engineering Template (FE Template).

Simple said, hard done.

As each class of entities (table, views, SPs, etc.) have their own block of generation code, it has to be done to each major entry points.

As for the SQL Server 2005 Erwin's template at its 7.3 version, the code below, injected at the beginning of the 'Create Entity' template will do for table DMLs.

/*

  We will save a global flag '_SQL_USE_DATABASE' is used to flag a variable of the same name initialization */
/

@ifnot( IsGlobalFlagSet("_SQL_USE_DATABASE") )
{
    Set( "_SQL_USE_DATABASE", "")
    SetGlobalFlag( "_SQL_USE_DATABASE" )
}

@if( IsPropertyNotNull("SQLServer_File_Group_Ref") )
{
    PushReference( "SQLServer_File_Group_Ref" )
    PushOwner

    @ifnot( Equal(Value("_SQL_USE_DATABASE"), Property("Name")) )
    {
        FE::Bucket( "90" )
        "USE " Property("Name")
        FE::EndOfStatement

        Set( "_SQL_USE_DATABASE", Property("Name") )
    }

    Pop
    Pop 
}
@else
{
    Set( "_SQL_USE_DATABASE", "" )
}