Generate Database Wizard (Entity Data Model Tools)

The Create Database Wizard generates data definition language (DDL) for creating a database from an existing conceptual model. The wizard allows you to do conceptual modeling first then create a database that supports the model.

The Create Database Wizard requires the following to run successfully:

  • A valid conceptual model.


    The wizard does not require valid .edmx file. Only the conceptual schema definition language (CSDL) content of the .edmx file must be valid. For more information, see .edmx File Overview (Entity Framework).

  • Permission to add files to the current Visual Studio project. Upon completion, the wizard adds an .sql file to the project. This file contains DDL for creating the database.

  • A database connection. The wizard will prompt you for a connection to an existing database. This is done so that column types for the target database can be determined based on property types in your model, and so that connection string information can be added to your application.


    Only SQL Server 2008, SQL Server 2005, SQL Server Compact Edition, and SQL Azure databases are supported. Third-party support for other databases may be available.

Upon completion, the Create Database Wizard does the following:

  • Generates the store schema definition language (SSDL) and mapping specification language (MSL) that correspond to the provided CSDL. The .edmx file is updated with the generated SSDL and MSL.


    The wizard overwrites existing SSDL and MSL.

  • Generates DDL that can be executed to create a database and saves the DDL as an .sql file.


    The generated DDL is based on a table-per-type mapping strategy.

  • Adds connection string information to your App.config or Web.config file.

It is important to note that the Generate Database Wizard does not execute the generated DDL. To create the database schema that corresponds to your conceptual model, you must execute the generated DDL independently (for example, execute the DDL in SQL Server Management Studio).

In This Section

See Also

Other Resources

ADO.NET Entity Data Model Tools