Sql-Server

SQL Server 2008 R2: StreamInsight changes at RTM: HoppingWindow, TumblingWindow, SnapshotWindow

We’ve been working on updating our demos and samples for the RTM changes of StreamInsight. I’ll detail these as I come across them.

The first is that there is a change to the HoppingWindow. The first two parameters are the same in the constructor but the third parameter is now required. It is the HoppingWindowOutputPolicy. Currently, there is only a single option for this which is ClipToWindowEnd.

A similar change happened to the TumblingWindow. Curiously, it also takes a HoppingWindowOutputPolicy. I suppose that makes sense though as it is really just a special case of a HoppingWindow.

2010-05-07

Security-related database settings are not restored when a DB is restored

A question came up today about whether it was a bug that the TRUSTWORTHY database setting isn’t restored to its previous value when a database is restored.

TRUSTWORTHY is a very powerful setting for a database. By design, it’s not restored when a database is. We actually documented this behavior when writing the Upgrade Technical Reference for 2008.

The other settings that are not restored with a database (for similar reasons) are ENABLE_BROKER and HONOR_BROKER_PRIORITY. After a restore or upgrade of a database, you need to check these. (Note: HONOR_BROKER_PRIORITY was introduced in 2008 so it won’t apply to upgrades from 2005 but ENABLE_BROKER does).

2010-04-15

Book: Confessions of a Public Speaker: Scott Berkun

It’s probably apparent that I’ve been travelling again a lot lately as the number of posts related to books has gone up.

One book that I picked up along the way and really enjoyed was Scott Berkun’s Confessions of a Public Speaker. I could relate to so much of what Scott was talking about and there are quite a few solid nuggets of advice in the book.

It’s very important when you are regularly giving technical presentations to spend time learning about the “presenting” part of the task, not just about the “technical” aspects. I found it quite insightful when Scott discussed how giving technical presentations has so much in common with stand-up comedy. It’s not that you need to be a stand-up comedian but much can be learned by watching how good stand-up comedians ply their trade. They endlessly deliver the same material but need to make it sound fresh each and every time.

2010-04-08

Book: Pro SQL Server 2008 Service Broker: Klaus Aschenbrenner

I’ve met Klaus a number of times now and attended a few of his sessions at conferences. Klaus is doing a great job of evangelising Service Broker. I wish the SQL Server team would give it as much love.

Service Broker is a wonderful technology, let down by poor resourcing. Microsoft did an excellent job of building the plumbing for this product in SQL Server 2005 but then provided no management tools and no prescriptive guidance. Everyone then seemed surprized that the takeup of it was slow. I even heard noises questioning it’s future a while back and I hope those noises have quietened now. The lack of serious tooling in 2008 was a case of seriously “dropping the ball” regarding the product. It also highlights the other real problem with SSMS in the lack of extensibility. If a supported extensibility model for SSMS was available, others would have stepped up to the plate and we’d have really good Service Broker tooling by now, even when Microsoft hadn’t provided it.

2010-03-29

OT: Airlines and Podcasts

Those that know me know that I spend an inordinate amount of time on airlines. I also love podcasts, as you can tell from my www.sqldownunder.com site and show. So anything that combines the two is just awesome.

Fly With Joe fits that perfectly. Joe D’Eon provides great insights in his show. I was sad last year that he hadn’t posted many shows. I’ve also been quiet for a couple of months (but that’s about to change with a bunch of SQL Server 2008 R2 shows). But I’ve been so pleased that Joe’s got back into the cockpit on his show lately. And also providing some live streaming shows. Recommended!

2010-03-20

SQL Server 2008 R2 - Application and Multiserver Management Learning Materials

My colleagues and I have been working with Microsoft to produce the Metro training materials for SQL Server 2008 R2. We’ve using those materials to train other trainers around the world. (If anyone will be in Reading in the UK next week, ping me and say “hi”. Same for London the following week).

Roger Doherty’s group have been hard at work turning these materials into consumable bite-sized pieces of training. This involves videos, demos and hands-on-labs.

2010-03-04

SQL Server Reporting Services: Should support include files

It’s common to want to embed custom code within reports in Reporting Services. One thing I don’t like is the inclusion of anything that looks like business logic directly in the reports. However, formatting functions, etc. seem totally appropriate.

If I want to embed custom code within Reporting Services though, I currently have two options. One is to embed the code in the report, the other is to reference an assembly. Each of these has drawbacks.

2010-02-19

DevWeek in London - coming up in March - early bird ends soon

DevWeek is on again this year.

Should be good to catch up with many of my European colleagues again. DevWeek is on March 15 - 19 at the Barbican Centre in London. The early bird pricing runs till 19th February.

A number of my colleagues will be speaking as well: Itzik Ben-Gan, Javier Loria and Davide Mauro.

I’m looking forward to seeing them and all the SQL crowd that will make it to London for the event.

2010-02-02

New entry in the unbelievably-misleading error message category: Windows 7 x64 RDP Client

I spent quite a while earlier trying to make an RDP connection to another system on my network. The error message from the RDP client was:

Your computer could not connect to another console session on the remote computer because you already have another console connection in progress.

You can imagine the range of things I tried to resolve the issue.

The actual issue? The machine had a new IP address and I was trying to connect to its old IP address. Great error message :-(

2010-01-23

Stored Procedure Contracts - Return Values

Yesterday’s blog post on the need for contracts for stored procedures caused a lot of comments and email. One of the most interesting comments came from Jamie Thomson regarding return values. Jamie’s totally correct on this. Return values should be part of any contract.

I’ve been thinking further about how return values should be incorporated into a contract and initially thought it should be something like this:

CREATE OR ALTER PROCEDURE SomeSchema.SomeSproc (someparameters)

WITH CONTRACT SalesOrderHeaderAndDetails ENFORCED

     (ROWS OrderHeaders(SomeColumn INT, SomeOtherColumn NVARCHAR(50) NULL),

           OrderDetails(AnotherColumn INT, YetAnotherColumn INT, 

                        EvenYetAnotherColumn GEOGRAPHY),

      RETURNS INT,

      EXCEPTIONS NoSuchCustomer(50020,'No such Customer'),

                 DuplicateOrder(50022,'That order already exists')),

     EXECUTE AS (execution options here if needed)

I thought the values could be RETURNS INT or RETURNS NULL, but on reflection (no pun intended), I realized that in many cases it is necessary to resort to documentation to know what a stored procedure return value is. That would be eased if the return value also had a name as part of its metadata. So perhaps a more complete contract would look like:

2010-01-20