Add New Skills!

Udemy
Showing posts with label Project Juneau. Show all posts
Showing posts with label Project Juneau. Show all posts

Saturday, October 1, 2011

Project Juneau: SQL Server Database Development and ADO.NET entity framework

 

This blog post is compiled from a presentation on Project Juneau in Teched 2011 and it highlights the key features of the product.

SQL Server development is now deeply integrated with Visual Studio Development environment. It enables developers to write T-SQL while working on Entity-Framework projects.

We start by adding an Entity Data Model (edmx) to our project.

image

choose database project:

image

Changes to the Data Model (edmx) are instantly propagated to the database. The idea here being, you build the database as you build your application. You don’t need to spend additional time later to synch up the application with an existing data model.

image

Create association between entities:

image

No initial setup of database is required. Juneau creates a localDB to work with using SQL Server Denali’s feature called Local DB Runtime. The local DB Runtime is a on-demand, file-based local DB instance that can be used with the Visual Studio Project for debugging and testing.

image

Create Stored Procedures directly in Visual Studio and get rich intellisense support:

image

Create Triggers:

image

Create Database Snapshots using SQLX files and refer them in your app. Shapshot is a point-in-time reference of your database in your project. You can then refer the SQLX Snapshot than the database project – similar to referring a DLL in your project. Snapshots can also be created from a live database.

image

Once you create your snapshot, you can then publish your changes to your database:

image

image

image

Output:

image

After deployment, you can continue to work on your application without your database by referring to the SQLX snapshot. With Snapshots, we can also do a schema compare – this is helpful in identifying the changes between the two snapshots.

image

Note the Code diff below:

image

Debugging your application lets you step through your Database Stored Procedures/Triggers within Visual Studio.

image

Start Debugging:

image

image

Database Projects can be easily deployed to SQL Azure.

image

As soon as you set the target platform to SQL Azure, the Visual Studio validates the project to ensure we are not violating any constraint that Azure has.

image

Publish Database to SQL Azure:

image

References:

http://blogs.msdn.com/b/ssdt/

http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DEV314