SQL Server Express and .NET Framework 4

[update 1/17/2012: Fixed formatting and clarified all comments apply to all future Service Packs of SQL Server 2008 Express and SQL Server 2008 R2 Express]

[update 4/28/2010: All comments in this post apply to .NET Framework 4 RTM and to SQL Server 2008 R2 Express]

We have just shipped a new package of SQL Server 2008 Express SP1 that supports .NET Framework 4 Beta 2, extending the range of .NET Framework versions supported by SQL Server 2008 Express SP1 to .NET 2.0 SP2, 3.5 SP1 and 4 Beta 2.

The reason for this change is that Visual Studio 2010 Beta 2 ships with .NET Framework 4 Beta 2. It also distributes SQL Server 2008 Express, which originally required .Net 2.0 SP2 or 3.5 SP1. As a result Visual Studio team had to include two versions of .NET Framework in Visual Studio 2010 Beta 2 because of SQL Server 2008 Express – not the best user experience :-). Obviously that will also apply to any applications that will want to use the new .NET 4 Beta 2 and SQL Server 2008 Express; with the new package they will avoid having a dependency on two .NET versions!

We decided to find a way to add .NET Framework 4 Beta 2 support in SP1 for SQL Server 2008 Express. The biggest challenge was that .NET 4 Beta 2 was still under development when we were shipping the SP1 for SQL Server 2008. So we added the code to support .NET Framework 4 in SP1, but blocked the code in the initial release. We waited for .NET Framework 4 Beta 2 bits to stabilize and then verified it again that SQL Server 2008 Express SP1 works well with .NET Framework 4 Beta 2. Only now do we feel we’re ready to release the package of SQL Server 2008 Express SP1 that has the .NET Framework 4 Beta 2 support unblocked.

Another problem we realized was that SQL Server Engine can host only one version of .NET Framework (I mean SQL Server .NET Integration aka SQLCLR). So hosting .NET Framework 4 Beta 2 in SQL Server Engine means it cannot host .NET Framework 3.5 SP1. That would be breaking change, something we never do, especially in Service Packs. We want to make sure that our Service Packs never break any users’ applications. So we looked at the SQL Server 2008 Express and concluded that even without SQLCLR-based features it provides tons of valuable functionality. Therefore, we decided that SQL Server 2008 Express SP1 will install with .NET Framework 4 Beta 2, but will only host .NET Framework versions based on CLR 2.0 – .NET 2.0 SP2 and 3.5 SP1. The good part is that when SQL Server 2008 Express is installed with .NET Framework 4 Beta 2 only, nothing is lost. The user can just install .NET Framework 2.0 SP2 or 3.5 SP1 and all SQLCLR-based functionality will just start working.

Q & A

Here’s more information about this package, in the form of a Q&A list.

Does new SQL Server Express package install with old .NET Framework (2.0 SP2 or 3.5 SP1)?

Yes, the new package installs with .NET Framework 2.0 SP2 or 3.5 SP1 or 4 Beta 2. We added .NET Framework 4 Beta 2 as a new option without removing any of the existing options.

Will it work with .NET Framework 4 RTM?

Yes, the new package will work with .NET Framework 4 RTM once it ships.

Does all SQL Server Express functionality work with .NET Framework 4 Beta 2?

No, there are few features that still require .NET Framework 2.0 SP2 or 3.5 SP1. These features will be disabled if .NET Framework 4 Beta 2 is the only .NET Framework on the machine, but will start working the moment .NET Framework 2.0 SP2 or 3.5 SP1 is installed.

The list of features that don’t work with .NET Framework 4 Beta 2:

  • The CLR data types geometry, geography, and hierarchyid.
  • The dynamic management views for assemblies and spatial objects.
  • The CLR user-defined types, functions, aggregates, procedures, and triggers.

Why some features don’t work with .NET Framework 4?

SQL Server Engine can only host one version of .NET Framework. In SQL Server 2008 it is .NET Framework 3.5 SP1. So hosting .NET Framework 4 Beta 2 in SP1 would mean that we no longer host .NET Framework 3.5 SP1. We simply don’t do this kind of breaking changes, since we try very hard to make sure that our Service Packs do not break any applications.

Do all SQL Server editions support .NET Framework 4 Beta 2?

No, the .NET Framework 4 Beta 2 support is only available in the Express edition (in Runtime Only package).

Do all SQL Server Express editions support .NET Framework 4 Beta 2?

No, the .NET Framework 4 Beta 2 support is only available in the Express (Runtime Only) edition. SQL Server 2008 Express with Tools and SQL Server 2008 Express with Advanced Services still require .NET Framework 3.5 SP1.

What are the functional differences between original SP1 and the new one with .NET Framework 4 support?

There are no differences. We put all the code necessary to support .NET Framework 4 Beta 2 in the original release of SQL Server 2008 Express SP1, the code was just blocked. In this new package we just unblocked the code allowing for working with .NET Framework 4 Beta 2.

Are the any other changes to the prerequisites of this package?

No, all other prerequisites of this SQL Express 2008 SP1 package are the same as the original one. The only change in the prerequisites of this package is that it supports .NET 4 Framework Beta 2, in addition to .NET Framework 2.0 SP2 and 3.5 SP1 supported by the original and the new ones.

Is the original SQL Server 2008 Express SP1 replaced by the new one?

No, both SP1 packages are available and valid. Feel free to use any of them, as I said, apart from .NET Framework 4 Beta 2 support, they are identical.

Why didn’t we ship .NET Framework 4 support in the original SQL Server 2008 Express SP1?

When we shipped the SP1 for SQL Server 2008, .NET Framework 4 Beta 2 was still under development. We had to wait for the final version of .NET Framework 4 Beta 2 to test the Express SP1 with it and make sure they work well together.

Example: Imagine we just shipped SP1 with .NET Framework 4 Beta 2 support. Then imagine a week later we discovered a security issue in .NET Framework 4 Beta 2. Say the fix to this bug breaks SQL Server Express Setup. Our policy is that security issues take precedence before any other problems, so we would have fixed the security bug and break the SQL Server Setup. That would put many people (including myself) in a really bad place! :-)

Is there something wrong with the original SQL Server 2008 Express SP1?

No, as I said, both packages are identical (apart from .NET Framework 4 support). And we’re keeping both packages available on Microsoft Download Center, so if some application already depends on the original package

Will future Service Packs of SQL Server Express have two versions as well (one with .NET Framework 4 support and one without it)?

No, going forward all Service Packs for SQL Server 2008 Express and SQL Server 2008 R2 Express wil support .NET Framework 4.

Is there a new package for the general Service pack 1 for SQL Server 2008 (the one that can patch SQL Server Standard edition and above)?

No, there will be no special package for the general SQL Server 2008 Service Pack 1. .NET Framework 4 Beta 2 support is only available in the Express edition of SQL Server 2008 SP1, so updating the general SP1 package wouldn’t make any sense.

How can I get the new SQL Server 2008 SP1 with .NET Framework 4 Beta 2 support package?

The most natural place to get SQL Server 2008 Express SP1 with .NET Framework 4 support is … Visual Studio 2010 Beta 2. Just go here and install Visual Studio 2010 Beta 2 with SQL Server 2008 Express SP1.

Obviously, we’re also planning to include it in the final release of Visual Studio 2010.

You can also download it directly from Microsoft Download Center here:

https://www.microsoft.com/downloads/details.aspx?FamilyID=01af61e6-2f63-4291-bcad-fd500f6027ff&displaylang=en

 

- Krzysztof Kozielczyk