OdeToCode IC Logo

The Shared Folders

Monday, December 27, 2004 by scott

Tomorrow, dear reader, is not a day I am looking forward to.

Tomorrow, I’m going into the labyrinth alone. I’m heading into the shared folders.

The shared folders embody the essence of our company. They contain the past and the future - all inside of a single hierarchical structure.

A few months ago, I went into the folders, and they looked something like this:

I went to the powers that be, and asked for some insight as to the structure I found. Are the final specifications the complete specifications? Or are the complete specifications the final specifications? Do we make final specifications, then review, update, and mark them complete? Or do we make a complete set of specifications, then update, review, and mark them as final?

I suggested wikis, portals, or anything with WebDAV to make some sense of our artifacts, but the powers that be like folders. Shared folders. Shared folders with a deep hierarchy. The deeper the better.

The powers that be told me the folders would undergo a reorganization, and the latest version of specifications would be easier to find. Past versions would be put into an archive folder. “Great!”, I said. I returned to the shared folders a few weeks later to find this:

Looking at this, I feel like David Carradine’s character in the old Kung Fu series.

That is not a puzzle, Grasshopper. It is only something you do not yet know

Atkin’s Query Plan

Friday, December 24, 2004 by scott

One of our customer’s warehouses threw a fit over an extraction query this week. The query ran for two hours before we cancelled. We expected the query to run for about 5 minutes, but the database turned out to be subtly different then the testbed we use for optimizations. Here is a zoomed out view of the estimated query plan we started with:


Notice the line along the top where SQL is working hard between join steps to prepare data for the next join. After every little change to the query and indexes, I’d revisit the zoomed out plan to see if it was getting any skinner. I was thinking of calling this technique “big picture optimization”, or the “Atkins query plan”, but that’s just silly talk isn’t it? Here is a plan that finished in 4 minutes:

And with this picture of success, I’ll wish everyone reading a merry Christmas.

Even More On Static Members

Thursday, December 23, 2004 by scott

Bruce brought up an important point about my MSDN article that I left understated. In order to show the full impact of the beforefieldinit flag on a type constructor, the code has to compile with optimizations.

Also, many optimizations take place with the JIT compiler, but the JIT doesn’t optimize when the app is running under the debugger. See John Lam’s post “Beware of Heisenberg effects” for in-depth coverage.

Static methods are debated regularly in the forms and newsgroups. I posted two little OdeToCode tidbits on the subject: Statics & Thread Safety Part I and Part II.

This Post Brought To You By The Letter K

Wednesday, December 22, 2004 by scott

When I was in school, I decided in addition to needing money I desperately needed to expand my cooking repertoire beyond grilled cheese sandwiches and scrambled eggs, so I applied to be a cook at a steak house restaurant. After three years of part time work in a kitchen, I came away knowing a lot more about meat, fish, and vegetables.

A funny thing happened along the way, and it started the day I was hired. It went something like:

Manager: So, ahhh, Kenneth. Do you prefer to go by Kenneth or Ken?

Me: Actually, I use my middle name, which is Scott.

Manager: Oh ok. Well, I’d like for you to come in for some training next Tuesday at 3. Can you make it?

Me: Yes I can!

Manager: Ok, see you then, ahhh, Ken.

Sure enough, when I arrived for training I had a brand new name tag with “Ken” emblazoned on it. I tried over the next few weeks to get a new name tag and convince people to call me Scott, but it never worked, and eventually I gave up trying.

I sort of enjoyed my alias. I’d throw on an apron and instantly transform from Scott the Student to Ken the Cook. As I worked up the ladder from making deep fried cheese to actually putting filet mignon to the flame, Ken became more of an alter ego. Ken made the best blackened prime rib in the East.

If you’ve ever worked at a restaurant you’ll know it’s actually as much of a social institution as it is a place of business. You work late hours. The dinner rush is stressful. You scream and yell at your co-workers, and to relieve the stress you pull pranks when they are not looking. You put Tabasco sauce in their ice tea, or put fish heads on their car’s hood ornament* (it’s a lot like software development, right?). All of this activity forms a close bond between people, and you end up spending time together outside of work at parties and such.

Eventually, people who knew me as Scott the Student would end up in the same room as people who knew me as Ken the Cook. At least half the people in the room would be confused when any one person was talking to me or about me. This is an awkward social situation, but geeks get used to these, or learn to ignore them completely and go about enjoying ourselves. To this day there is still a subset of people who only know me as Ken (but I never see them anymore).

Anyway, in case you ever wondered what the K stood for (and you probably haven’t, but I can always change reality to suit my needs - it's fashionable, you know), it stands for Kenneth. My parents named me after an uncle who passed away before I knew him, but they wanted me to go by my middle name of Scott.

I throw the K in front of my name here because there seem to be a plethora of Scott Allen’s around. I wouldn’t want people to confuse me with the Scott Allen who wrote ‘A comparison of the Washington Naval Arms Treaty of 1922 and the Strategic Arms Limitation Agreements of 1972’. That is not a topic I can even make conversation about at a dinner party. There is also the folk singer, the rodeo announcer, and the golf pro. We’re everywhere!

*Not that I’ve ever done this. I just heard rumors. It wasn't me. Quit looking at me like that.

Reporting Services News

Tuesday, December 21, 2004 by scott

Here are some miscellaneous tidbits I picked up about Sql Server Reporting Services over the weekend.

Service Pack 2

It looks as if Service Pack 2 will bring some new features to Reporting Services, including client side printing, SharePoint integration, and a new Report Viewer component. The man, myth, legend, and mid-Atlantic Developer Community Champion Geoff Snowman will deliver a webcast about the new features on January 10.

People have complained about the lack of a ‘direct print’ feature in Reporting Services since the initial release. Earlier this year it was refreshing to see Group Program Manger Brian Welcker point out in the newsgroups why there is was no direct print even after SP1:

I'm not sure where the idea that client print is "simple" comes from. Since we can't use the browser print functionality (it is horrendous), we have to create an ActiveX control that collects print settings and then talks to the server to generate EMF files that can be routed to the printer. It is certainly doable, but not trivial.

That pretty much sums up my feelings about printing in Internet Explorer, both from a development viewpoint and as a user. Will it ever get any better?

PDF Troubles?

If you have a subscription setup to deliver a report in PDF format via email, you might be seeing error messages when trying to open the attached PDF. If so, check out KB 872774 and download an updated ReportingServicesEmailDeliveryProvider.dll.

In a newsgroup post, Daniel Reib (MS) said the title of the KB article is misleading. The problem is with a Unicode byte order mark in the attachment, meaning the problem is not restricted to just Lotus Domino.

Rendering In Word

I’ve heard a few people lament the fact that Reporting Services cannot render a report into Microsoft Word format. Brian Welcker also addressed this topic in a post:

“Right now, it is not scheduled for SQL 2005. It is a lot of work and we don't want to introduce a new rendering extension without the ability to get it right. Fortunately, we can add new extensions without changing the server.”

Forms Authentication

If you want to use forms or custom authentication with reporting services, then you'll need the enterprise version to develop a custom security extension. The price difference between standard and enterprise gets people a bit upset when they realize this limitation. Brian addressed this subject in the newsgroups too:

While most security extensions are used in SSO / enterprise or Internet scenarios, we understand that some people will want to use forms authentication without a full security extension. It is under consideration but not sure it will get addressed.

Top Features for SQL 2005

Monday, December 20, 2004 by scott

The CLR gets all the press in articles about SQL Server 2005, but I think the most popular features won’t involve CREATE ASSEMBLY. The most popular features will be those that prevent ‘uncomfortable conversations’. You know, those conversations you don't want to hear....

Feature: DDL Triggers
Prevents: Well I thought I was in the test database when I dropped the Orders table, but, um, well, um. We have a backup right?

Feature: Snapshot Isolation
Prevents: Hi, I’m Sandy with the Oracle Corporation. Your application will suck wind with with their database. Pick us. We can do things they can’t do, blah blah blah multi-version consistency blah blah blah. I’m not leaving till you pick us.

Feature: TRY/CATCH in T-SQL
Prevents: “This stored procedure has more litter in it than the Hudson river.“

Before After
BEGIN TRANSACTION
  
  UPDATE Categories SET CategoryName . . .

  SET @Error=@@ERROR
  IF @Error <> 0 BEGIN
    RAISERROR('blah blah blah',16,10)
    IF @@TRANCOUNT <> 0 ROLLBACK
    RETURN(@Error)
  END

  INSERT INTO Categories . . .

  SET @Error=@@ERROR
  IF @Error <> 0 BEGIN
    RAISERROR('blah blah blah',16,10)
    IF @@TRANCOUNT <> 0 ROLLBACK
    RETURN(@Error)
  END

COMMIT TRANSACTION
BEGIN TRY

  BEGIN TRANSACTION
    UPDATE Categories SET CategoryName . . . 
    INSERT INTO Categories . . . 
  COMMIT TRANSACTION 

END TRY

BEGIN CATCH
  IF @@TRANCOUNT <> 0 ROLLBACK
  SELECT @Error = ERROR_NUMBER()
  RETURN (@Error)
END CATCH

Yes, nice indeed.

Omea Reader

Friday, December 17, 2004 by scott

Earlier this month Christopher Steen gave a CMAP presentation on ReSharper by JetBrains. Chris had a lot of ‘oohs’ and ‘aahs’ going. I was prepared to steal Chris’s laptop and lock myself in a room- just to spend a few minutes alone with the tool before surrendering to police, but I exercised patience instead.

While checking out the JetBrains site I noticed Omea Reader (currently free) and Omea Pro. I’ve been looking for a better newsgroup reader. For the last 10 years I’ve used Agent, but it still doesn’t support multiple newsgroup servers in a single instance.

Omea Reader currently supports multiple newsgroup servers, has a sharp interface and RSS feeds. The app offers various ways to categorize, annotate, and flag posts. The major downside to me is the need to use the Ctrl key for short cut operations, like to mark a post as read, or move to the next unread post. There also doesn’t appear to be a kill file, or a way to mark a thread to ignore. Without these features, the app feels too cumbersome for high volume groups (300+ posts a day). Agent has these features, and the commands need only a single finger.

Omea Reader isn’t quite out of the running yet though, because there is a plug-in architecture….