I had pulled in an existing sql server database into my LLB project, but later I needed to reference a different, slightly modified version of the database (different database/schema name, but 95% same as first database).
I added this new database in the Project Explorer --> Relational Model Data.
I deleted the first database from the Catalog Explorer.
Now, I want to rebuild my entities based on the new database I am referencing, and remove the entities mapped to the old database.
I set "RemoveUnmappedElementsAfterRefresh" to True, thinking this would delete those entites, but it seems to not do that.
If I try to "refresh relational model data from database" I get:
"One or more errors or problems detected during the project validation and relational model data adjustment process. Please check the 'Errors' window for details"
The errors (one for every entity) are like:
Message type: Error
Message text: The entity 'mySchemaName.myTableName' has a mapping definition for the target database with driver 'SQL Server 2000/2005/2008/Express Driver (SqlClient)' but there's no target element specified in the mapping.'
Source: mySchemaName.myTableName
Created on: Wednesday, April 13, 2011 11:35 AM
Corrections/suggestions
Choice 1: Open 'mySchemaName.myTableName' in its editor and manually map the entity to a target.
Choice 2: Auto-map 'mySchemaName.myTableName' onto a new or matching existing target in relational model data for database 'SQL Server 2000/2005/2008/Express Driver (SqlClient)'
It seems if I just choose #2: (Auto-Map), this cleans up the problem.....but going through all entities is a bit tedious....would it be possible to have an "auto map all" option?
(And as for choice #1....I couldn't see where you could actually manually change where an entity was mapped, although maybe I didn't look closely enough).
Having the ability to both multi-delete entities in the project explorer, and auto-remap all entities (in the case where you've changed your database for whatever reason) would be nice additions, if this functionality isn't already there and I'm missing it.
UPDATE:
Actually, it seems the Auto remap didn't work.....I just ended up with a bunch of errors like:
Message type: Warning
Message text: The Table 'myDBName.mySchemaName.myTableName' can be considered orphaned (no project element is mapped onto it)
Source: Project Relational Model Data Adjustment
Created on: Wednesday, April 13, 2011 11:54 AM
Corrections/suggestions
Choice 1: Exclude the element from the project
Choice 2: Mark the element for deletion
Choice 3: Leave as-is