Create and upgrade SQL Server database using a Visual Studio 2010 Database Project

May 31, 2011

Contents

Introduction | Objectives | Objective 1: Create a new database |
Objective 2: Create a Full Upgrade
| Deploying Manual Schema Changes | Objective 3: Create a partial upgrade | Using Configurations | CruiseControl Integration | NetTiers Integration

Introduction

Maintaining your database structure within Visual Studio allows you to rebuild the database from scratch and keep a record of the modification history in SourceSafe or TFS.

On one particular project, I used the standard SQL Server Project provided in Visual Studio 2005 creating my own directories to separate schema objects such as tables and stored procedures. A custom application would run the scripts in the project in a defined order to allow you to create and upgrade the database.

Recently I decided to migrate the solution to Visual Studio 2010.

When I attempted to convert the SQL Server Project I came across all kinds of issues. Such as the compilation not working because some commands such as DROP and EXEC were not supported.

I also tried to reverse engineer the database project from SQL Server into Visual Studio 2010. Being a bit of a control freak, this did not satisfy me because I didn’t know what the reverse engineering had created. I could see there were issues (e.g. permissions were not scripted how I would like), so I decided to hand-craft the project from the scripts that already existed in the old SQL Server project.

Below is a record of the objectives, along with everything that needed to be done to achieve the objectives.

Objectives

There were 3 objectives:

  1. Create a new database with test data
  2. Create a full upgrade: restore the previous version of the database and run schema and data upgrades
  3. Create a partial upgrade: run schema and data changes on a database that has already been generated via the full upgrade (e.g. stored procedure changes) (for high load iterative development or potentially iterative deployment)

Read the rest of this entry »


Microsoft Developers, it’s time to prioritise HTML5

May 6, 2011

The battle between Silverlight vs HTML5 continues, with Microsoft prioritising HTML5.

The latest specifications for HTML5 were released on 27 April 2011. You can view them at
http://dev.w3.org/html5/spec/Overview.html

Last year, in October, Bob Muglia (Microsoft President in charge of server and tools) said that Microsoft’s “strategy has shifted” and that “HTML is the only true cross platform solution for everything” (Read more).  Microsoft have invested significantly into HTML5 compliance in the recently released IE9.

Muglia later tried to clear up the confusion by stating in the Silverlight Team Blog: “Make no mistake; we’ll continue to invest in Silverlight and enable developers to build great apps and experiences with it in the future.”

However, Steve Ballmer also issued a Press Release in which he said: “HTML 5 will provide the broadest, cross-platform reach across these devices, and Microsoft will build the world’s best implementation of HTML 5 for devices running Windows”

Ballmer also tried to reassure us by emphasising that Microsoft will still invest in Silverlight, which he said ”provides the richest media streaming capabilities on the web”.

While Microsoft are reported to have de-emphasised Silverlight at MIX11 (a gathering of Web developers in Las Vegas in April 2011), they did announce the Silverlight 5 Beta Release (Silverlight 5 Beta and Tools are available for download here).

Not sure whether you should use Silverlight or HTML5? Scott Hanselman makes an astute observation: “Use HTML when it makes sense to your solution. Use a plugin when it provides unique functionality… Apply common sense”.

What is HTML5?

HTML5 is the next major version of HTML (HyperText Markup Language), the key coding language behind the World Wide Web. The previous version, HTML 4.01, was published as a W3C Recommendation in December 1999, and this new version is set to transform web development.

HTML5 provides new functions that provide a much richer user experience on what is a universal platform — without any need for a plugin.

In conjunction with the new version of Cascading Style Sheets (CSS3),  ”things that you used to have to use Silverlight, Flash, or custom/dynamic images for, you can now do with a single line of code” (Sanford).

New elements include:

(1) The Canvas Element used for “rendering graphs, game graphics or other visual images on the fly”.

(2) Video and Audio Elements make it possible to directly embed streaming multimedia without third-party plugins.

(3) Offline Web Applications – the ability for users to “continue interacting with web applications and documents even when their network connection is unavailable”.

(4) Geo-location support to make the most of a user’s location.

[See What is HTML5 Infographic]

Tim O’Brien, a general manager in Microsoft’s platform strategy group, has stated that they will place more emphasis on HTML5 at the upcoming Professional Developers Conference in September 2011.

So, now it’s time for Microsoft developers to prioritise HTML5.

Remember, HTML5 is not 100% complete, but you can get ready to use it.

Developers may anticipate using HTML5 in conjunction with MVC 3.  Visual Studio 2010 lets you work with HTML5 now — although you do need to make a small change after installing SP1. Scott Guthrie has a great blog post: “HTML5 Improvements with the ASP.NET MVC 3 Tools Update

You can delve into the many interesting sessions on HTML5 from MIX11.

- Alister


Follow

Get every new post delivered to your Inbox.