Share via


2.1.3 Reverse Engineering a Database and Creating an EDM Model

A schema from a relational database, such as Microsoft SQL Server, can be reverse-engineered into an EDM by using the EDMGen.exe tool that is included in the Microsoft .NET Framework 3.5 Service Pack 1 (SP1) and in the Microsoft .NET Framework 4.0. Alternatively, Microsoft Visual Studio 2008 Service Pack 1 (SP1) and Microsoft Visual Studio 2010 can be used.

This data portability scenario describes how to use the EDMGen.exe tool to create an EDM.

To reverse-engineer a database and to create an EDM

  1. From a command prompt, run EDMGen.exe by pointing it to the database that you want to reverse engineer into an EDM.

For example, the following command-line command uses the Northwind database schema that is installed on a local instance of Microsoft SQL Server Express. This command reverse engineers an EDM model (CSDL file) along with the corresponding SSDL schema and MSL mapping metadata:

 edmgen.exe /mode:FullGeneration /connectionString:"server=.\sqlexpress;integrated security=true;database=Northwind" /project:Northwind /namespace:Northwind /EntityContainer:NorthwindEntitites