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
In Visual Studio 2010, open the
SetupApplicationproject. For more information, see How to: Create a Model Using Visual Studio and "M".
In Solution Explorer, right-click the SetupApplication project, and then click Properties.
In the project properties window, select the M Deployment section.
Click the ellipsis button next to the Database Connection String edit box.
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
In the database section, type a new database name, SetupApplicationDB.
It would also be possible to load the
SetupApplicationmodel into any existing database, such as the SQL Server Modeling Services database.
Click OK, and then click Yes to create the new database.
To deploy the setup model to the SetupApplicationDB database
On the File menu, click Save All.
In Solution Explorer, right-click the SetupApplication project, and then click Deploy.
On the View menu, click Output.
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.