How to: Load a Model into a SQL Server Database

[This content is no longer valid. For the latest information on "M", "Quadrant", SQL Server Modeling Services, and the Repository, see the Model Citizen blog.]

This is the second of five tasks that create a data-driven application by using the SQL Server Modeling CTP technologies. For an overview of this tutorial, see Getting Started with the SQL Server Modeling CTP (SetupApplication Tutorial).

In the previous step, you wrote a SetupApplication model in the Microsoft code name “M” language. For more information, see How to: Create a Model Using Visual Studio and "M". In the next step, you will deploy the “M” model to a SQL Server 2008 database. After the model and model instances are in the database, applications can easily access the model to drive application behaviors.

To modify the M Deployment settings for the SetupApplication model

  1. In Visual Studio 2010, open the SetupApplication project. For more information, see  How to: Create a Model Using Visual Studio and "M".

  2. In Solution Explorer, right-click the SetupApplication project, and then click Properties.

  3. In the project properties window, select the M Deployment section.

  4. Click the ellipsis button next to the Database Connection String edit box.

  5. In the Connection Properties dialog, enter the name of the target instance of SQL Server. For the default instance on the current machine, specify (local). For the SQL Server Express instance on the current machine, specify ./SQLExpress.

  6. In the database section, type a new database name, SetupApplicationDB.

    Note

    It would also be possible to load the SetupApplication model into any existing database, such as the SQL Server Modeling Services database.

  7. Click OK, and then click Yes to create the new database.

To deploy the setup model to the SetupApplicationDB database

  1. On the File menu, click Save All.

  2. In Solution Explorer, right-click the SetupApplication project, and then click Deploy.

  3. On the View menu, click Output.

  4. The output window should indicate a successful build and deploy.

In the next task, use SQL Server Management Studio to view the database representation of the SetupApplication model. For more information, see  How to: View a Deployed "M" Model in the Database.

See Also

Concepts

Creating and Using the SetupApplication Model