5

Closed

Reverse engineering Adventure Works database fails

description

This is currently By Design. We may be able to do something better with either still creating a valid model or providing more helpful feedback.

The designer is empty because the reverse engineering process encountered an error ""The table 'AdvWorksSalome.Production.Document' is referenced by a relationship, but cannot be found.""

When using edmgen, you get the below output.
C:\Program Files\Microsoft Visual Studio 11.0\VC>EdmGen /mode:FullGeneration /project:NorthWind /provider:System.Data.SqlClient /connectionstring:""server=datatoolshost\sql2008;database=AdvWorksSalome;integrated security=True;"" /targetversion:4.5
EdmGen for Microsoft (R) .NET Framework version 4.5
Copyright (C) Microsoft Corporation. All rights reserved.
Loading database information...
warning 6005: The data type 'hierarchyid' is currently not supported for the target .NET Framework version; the column 'OrganizationNode' in table 'AdvWorksSalome.HumanResources.Employee' was excluded.
warning 6005: The data type 'hierarchyid' is currently not supported for the target .NET Framework version; the column 'DocumentNode' in table 'AdvWorksSalome.Production.Document' was excluded.
warning 6031: The column 'DocumentNode' on the table/view 'AdvWorksSalome.Production.Document' was excluded, and is a key column. The table/view has been excluded. Please fix the entity in the schema file, and uncomment.
warning 6005: The data type 'hierarchyid' is currently not supported for the target .NET Framework version; the column 'DocumentNode' in table 'AdvWorksSalome.Production.ProductDocument' was excluded.
warning 6031: The column 'DocumentNode' on the table/view 'AdvWorksSalome.Production.ProductDocument' was excluded, and is a key column. The remaining key(s) were used and table/view has been created as read-only.
warning 6002: The table/view 'AdvWorksSalome.dbo.CustomerSegmentView' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.HumanResources.vEmployee' does nothave a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.HumanResources.vEmployeeDepartment' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.HumanResources.vEmployeeDepartmentHistory' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.HumanResources.vJobCandidate' doesnot have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.HumanResources.vJobCandidateEducation' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.HumanResources.vJobCandidateEmployment' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Person.vAdditionalContactInfo' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Person.vStateProvinceCountryRegion' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Production.vProductAndDescription'does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Production.vProductModelCatalogDescription' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Production.vProductModelInstructions' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Purchasing.vVendorWithAddresses' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Purchasing.vVendorWithContacts' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Sales.vIndividualCustomer' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Sales.vPersonDemographics' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Sales.vSalesPerson' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Sales.vSalesPersonSalesByFiscalYears' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Sales.vStoreWithAddresses' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Sales.vStoreWithContacts' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
warning 6002: The table/view 'AdvWorksSalome.Sales.vStoreWithDemographics' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.
error 6004: The table 'AdvWorksSalome.Production.Document' is referenced by a relationship, but cannot be found.
warning 6005: The function 'uspUpdateEmployeeLogin' has a parameter 'OrganizationNode' at parameter index 1 that has a data type 'hierarchyid' which is currently not supported for the target .NET Framework version. The function was excluded.
Generation Complete -- 1 errors, 27 warnings
C:\Program Files\Microsoft Visual Studio 11.0\VC>
"

This item was migrated from the DevDiv work item tracking system [ID=344317].

file attachments

Closed May 6, 2013 at 7:49 PM by RoMiller
This is a duplicate of https://entityframework.codeplex.com/workitem/1094
We're keeping the newer issue active because it contains more details about the root cause of the issue (lack of HierarchyID support).

comments

moozzyk wrote Dec 27, 2012 at 6:35 AM

moozzyk wrote Jun 20, 2013 at 9:40 PM

The new designer will not try creating relationships to non-existing tables so instead of the error and empty model you will get a model where invalid entity types/sets and relationships are commented out.