On Tuesday Mario Szpuszta has given a great presentation about SQL Server 2005: SQL Server Programmability & CLR Integration for the SQL Server Usergroup Austria.
Some highlights from Mario's presentation:
Hosting of the .NET Runtime
SQL Server hosts the .NET runtime, but of course SQL Server has higher requirements than other hosts. The runtime runs in the same process as the SQL Server (that's different from similar technologies from other vendors). This also means bigger security requirements. Both the .NET runtime hosting interfaces as well as the SQL Server had been changed to fulfill these requirements. SQL server has control over threads, memory...
Assembly Security
SQL Server has 3 groups to control security for assemblies:
- Safe: only defined FX may be used
- External access: network and file system access is allowed
- Unsafe: this is unrestricted
Application Domains
SQL Server uses 1 application domain for every database - compare this to the ASP.NET runtime that uses 1 application domain with every web site (IIS 6 also has application pools - different processes).
.NET Code and T-SQL
Mario demonstrated creating assemblies for SQL Server. Writing C# code in the serer is a great feature! This doesn't mean T-SQL shouldn't be used anymore. T-SQL is better (and easier) for relational access, while .NET code helps doing complex statements.
Why put logic in the database - a weblog by Mario.
UDTs
User defined types can be defined as ordinary .NET classes. However, there are strict requirements: onversion from/to string; optional nullability by implementing the interface INullable, no inheritance. UDTs can also be only normal columns (no indexing). Check constraint is possible.
It is possible to define user defined aggregates for UDTs. Aggregates are defined by .NET classes with four methods: Init, Accumulate, Merge, and Terminate and some properties.
A issue with UDTs is that if a new version should be used, all dependencies must be recreated (tables). This issue may change with the release.
Mario started a discussion about .NET UDTs in his weblog.
Planned Dates
Current plans for dates:
Beta 2 - Summer 2004
Beta 3 - Q4 2004
RTM - 2005
More information about the beta plans in Tom Rizzo's blog The Road to Yukon.
Mario has read the book Presenting to Win - The Art of Telling Your Story and adapted all his presentations with information from this book. I'm just doing the same. :-)
Christian