Export (0) Print
Expand All

Generate Database Wizard

[This page is specific to the latest version of the Entity Framework. The latest version is available as the 'Entity Framework' NuGet package. For more information, see Entity Framework Releases and Versioning.]

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.

    noteNote:
    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.

  • 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.

    noteNote:
    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.

    noteNote:
    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.

    noteNote:
    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

Choose Your Data Connection Dialog Box (Generate Database Wizard)
Provides a UI reference for the Choose Your Data Connection dialog box.

Summary and Settings Dialog Box
Provides a UI reference for the Summary and Settings dialog box.

Database Generation Rules
Provides details about the default rules that the wizard uses to generate a database.

How to: Customize Database Generation
Describes how to customize the database generation process.

See Also




Build Date:

2013-06-19
Show:
© 2014 Microsoft