Thursday, April 23, 2009

Be careful with join clauses when writing complex queries

Join clause evaluation is dependent on its position in the sql statement. In SQL Management Studio, if you try to specify the conditions incorrectly, you will receive the following error message:

SQLstatement

In X++, you will not receive any compilation errors, nor any runtime errors. In complex scenarios with a lot of queries, this might go unnoticed, and will be extremely hard to weed out at a later stage, when data inconsistencies crawl in.

Take, as an example, the following job. At first glance, the 2 methods look exactly the same, and it seems as if they should work just fine. But in reality, the second method will return incorrect results, because inventSum.InventDimId will be treated as a constant (empty string as the default value) and not as a table field used in the same select statement.

QueryBuild classes have a major advantage in this situation, as you cannot easily add join clauses (links) unless adding to the child (joined) queryBuildDataSource.

static void JoinClauseWarningJob(Args _args)
{
#define.ItemId("ESB-005")

void testCorrectJoin()
{
InventTable inventTable;
InventSum inventSum;
InventDim inventDim;

select inventTable
where inventTable.ItemId == #ItemId
join inventSum
where inventSum.ItemId == inventTable.ItemId
join inventDim
where inventDim.inventDimId == inventSum.InventDimId;

info(strfmt("Correct join where clause: %1", inventSum.AvailPhysical));
}

void testIncorrectJoin()
{
InventTable inventTable;
InventSum inventSum;
InventDim inventDim;

select inventTable
where inventTable.ItemId == #ItemId
join inventDim
where inventDim.inventDimId == inventSum.InventDimId
join inventSum
where inventSum.ItemId == inventTable.ItemId;

info(strfmt("Incorrect join where clause: %1", inventSum.AvailPhysical));
}
// Actually execute the code
testCorrectJoin();
testIncorrectJoin();
}

So, the suggestion is simple: Use QueryBuild classes (or AOT queries) whenever possible, and pay attention to the order of tables and join clauses in the select statements that you write.

Wednesday, April 22, 2009

Microsoft FY09Q3 Results

Last time we did quarterly results, it was a doooozy. Immediate layoffs for 1,400 Microsofties and sometime-in-the-next-18-months layoffs for 3,600 more. Of course, the layoffs were offset somewhat by continued crazy hiring for Live Search (should we expect a work of Shakespeare to pop out of there sometime soon, too?).

What kind of questions do you want to be asked during the conference call? Some off of the top of my head:

  • So... how's that, ah, layoff... thingy.. going?
  • Which groups and products are specifically being affected by layoffs?
  • What other cost-cutting measures are in effect?
  • What are the causes in drop of revenue and what are the expectations going forward (will Microsoft give guidance this time)?
  • What bright spots are there in profits?
  • How is gaining share going?
  • The EU seems to be pulling its leg way back for a full-on kick to Microsoft's financial groin. How does the defense against EU charges look to protect shareholder money for additional EU fines?
  • What does a financial geek have to do to get a beer at The Commons?

And you know, speaking of The Commons: I trekked over there today (meh, not the sunniest day) and I have to say it's an impressive space. I walked around admiring the scope of the project, thinking "This is what Windows built. This is what Office built." I then reflected on the irony that it's Mr. Robbie Bach's Entertainment and Devices moving into the new campus with The Commons. Windows and Office funded this extravagant place for the folks who managed to burn through $8,000,000,000USD+ on the Xbox, be shown how it's done right from Nintendo with the Wii, dash the Zune against the juggernaut iPod, and have the iPhone drop-kick WinMobile to Mars.

Microsoft Senior Leadership Team is rewarding something here moving these people into such a great place, but it's not anything that I could make sense of while I wandered the new campus...

I'll update this post later with commentary about the quarterly results. In the meantime, some of my favorite places to track insights and opinions on MSFT quarterly results:


Update: closing the loop here a little bit later than I wanted (sorry, I was bounced off the grid for a while):

Wow: have a plunge in profits and get rewarded by your stock shooting up 10%+ in one day! Sweet! And by "Sweet" I mean none of this makes a lick of sense except to look at an article like Cost-cutting saves Microsoft stock after rough 3Q and realize that the market is supposedly rewarding the stock price and recognizing appreciation for the reduction in overhead and expenditures.

So now, we must have a plan to have constant announcements about reduction of expenditures.

Announcement #1: No more Company Picnic. Ever. Next?

What would be on your short list of things to cut back on? MGX? The Company Meeting? Beer at morale events? Soda? The Company Store? Whole product groups? Your group? Yeah, I don't know how often that last one makes the list. Though I have friends who have sniffed the way the FY10 wind is blowing and are getting the hell out of groups that have spent more time talking about what they are going to do than actually doing anything or - get this - shipping something to actual customers. You know, the type of groups that make Yahoo's Carol Bartz slip in the F-bomb.

I'm surprised to learn from Ms. Fried's Company Picnic article above that The Company Meeting is still on. As much as I love the Company Meeting, it was totally dead and gone to me in my mind. Talk about the most challenging Company Meeting ever. Yes, we'll have Win7 and coming in close Office 14, along with other emerging products. But how in the world to you manage to pull off a great Company Meeting within our current environment? You have to take the big issues head-on, and part of that will be looking at the upcoming MSPoll numbers and actually sharing with Microsofties who they hell were let go as part of the layoff. And why.

The Company Picnic boggled my mind just looking at the logistical nightmare it had turned into. Tell you what: if we reduce the company size back down to something reasonable, we should bring it back. But for now, I'll be happy with my group renting space for a family morale team event at Vasa Park.


CRF: unmoderated comment thread: Microsoft FY09Q3 Results.


Wednesday, April 15, 2009

Spitfire Backfire, Live Labs, and Not My 1,400

Here's a quick post before next Thursday's quarterly results. Given the layoffs in the last quarterly results I know there is some increased anxiety about any additional cost cutting Mr. Ballmer might be ready to unleash, like more staff reductions or, you know, "Hey congratulations on entering RC and all. Now... about that next release and, well, you specifically..."

Mr. Joseph Tartakoff over at paidContent has a post around further reductions: Microsoft Still On Track To Cut Another 3,600 Jobs.

Contrition time for me: last post I shared how amazed I was that everyone in the 1,400 that I knew or that were in my extended network got rehired. Pretty much the feedback I heard here and on Twitter was, "Wow, you're one lousy sample set," because a number of you are either in the non-presently-Microsoftie 1,400 or know plenty of people in that pool.

I wish I could blame it on drinking too much at Spitfire but, (1) it wasn't opened yet, and (2) it will never be opened thanks to the brazenly stupid idea to have it planned and ready to go for what seems like the better part of a year and then three days before it was to open, Microsoft yanks the rug out from under Spitfire and thirsty Microsoftie patrons.

You know, if upfront the Senior Leadership Team had decided that a bar was an interesting idea but didn't make sense for Microsoft I would have just shrugged and scooted over to a Mustard Seed, had I even heard of the idea. But to have this set up for so long with curious expectations building in Redmond and then to have a last minute revelation and cancelling Spitfire really calls into question basic judgment and execution abilities.

So-- what, what's that? Hmm, checking in over at the Bring Spitfire back to Microsoft Facebook group (http://www.facebook.com/group.php?gid=70887074034) it appears Spitfire is on track to open at the end of the month? From Jonathan Sposato:

thx for everyone's support! OK there's GOOD NEWS today; the spitfire has reached an agreement in principal with msft to open on the west commons campus later this month : ) over the last few days, both parties re-engaged and worked creatively to find a way to deliver on a great spitfire experience on campus.

('scuse me while I tweet that.) Great! Allow me to raise a glass. Now I'm vaguely curious to know about all the soap-opera court-intrigue going on behind the scenes here. And I can cancel my idea for a BYOB + Towel Commons protest.

Update: well, not so fast, you twittering fool. Looks like the compromise is pretty extreme, in that drinks will only be served for scheduled special events. Hmm. More by Mr. Todd Bishop here: Microsoft revives Spitfire pub under compromise arrangement.

One last thing: Live Labs recently restructured, with some projects going forward and others getting the axe and the researchers being repurposed into groups like Mobile and Search. I've only had superficial dealings with Live Labs folks and I found them very refreshing compared to other teams in research I had planned with: a sort of practicality that was uncommon. To add a few more words here, we'll end with a special guest writer reflection on the recent Live Labs happenings:


Microsoft (NSDQ: MSFT) is downsizing its high-profile Live Labs group, which was created three years ago to speed up innovation in the company’s online business, paidContent.org has learned. -- Joseph Tartakoff, Microsoft breaks up its Live Labs group, 2009

Microsoft describes it as a "restructuring". About half of the team will be moved to various product groups. The remaining half, still run by former Overture/Yahoo star Gary Flake, will focus on search, data organization and user experience aspects. There's more information in articles by Mary Jo Foley on ZD Net, Ina Fried on CNET, and Gavin Clarke in The Register.

Contrary to recent whispers and tweets, we are not shutting down, disbanding, dismantling, or anything of the sort. In the coming weeks and months we'll bring you updated developer tools, new ways to use Seadragon, and much more. Going forward, we intend to focus on a smaller number of projects relative to what we've done in the past, but invest in them at a much bigger scale. -- What's next for Live Labs, on the Live Labs blog

Mary Jo comments that "Microsoft execs often touted Live Labs as proof that Microsoft is an innovator, not just a follower," and there's no question that the acquisition of Seadragon and merging it with Microsoft Research technologies has a chance to be transformational. Photosynth is an encouraging start, and there's a lot more to build on. A tighter focus and bigger bets could be a good thing here. On the other hand, Live Labs was also supposed to be a company-wide (or at least Windows Live/MSN-wide) innovation center. Gary's 2006 Live Labs Manifesto and coverage at the time like Ina Fried's captures the original vision: bridging the gap between research and the product groups and revitalizing how software is developed. This was always going to be a tough sell, with senior executives like Steven Sinfosky firmly against the idea of a separate innovation group outside of their control. The restructuring seems to throw in the towel on this front. And Microsoft spokeswoman's Stacy Drake McCredy's comments in paidcontent.org are somewhat alarming:

Economic conditions are imposing constraints that challenge the original Live Labs model by diminishing the group’s ability to transfer innovations to business groups who’re understandably giving priority to “needs” vs. “opportunities.”

Well yeah, it is understandable. But what this is saying that Microsoft product groups aren't in a situation where they can take advantage of opportunities. It's really hard to see that as a recipe for long-term success.


Administrivia: The Cutting Room Floor is unmoderated and folks have been pleading for me to shut down the red-hot discussions over there. I moderate here - when I can manage - to keep things on track. If the CRF can be the crazy diatribe magnet and that makes moderation here all that more easy: fan-damn-tastic.


CRF: Unmoderated thread for "Spitfire Backfire, Live Labs, and Not My 1,400"


Sunday, March 29, 2009

Shared Sacrifice and Microsoft Free Radicals

How have you been doing? Me, I've been doing some kind of wonderful.

Since I pressed the pause button (a button I'm going to be enjoying quite often) a lot has happened yet not happened. Sort of like those layoffs. Just like you and your fellow Microsofties, I talked to a lot of people who where either affected by the 1,400 cut or who had a friend affected. From just my perspective, everyone I know or know-of through someone in Redmond was... rehired.

When's a layoff not a layoff?

I mean, even the folks I muttered, "Whew, thank goodness they took their badge and finally got rid of 'em" got rehired. Sheesh. We can't even do layoffs right. For at least the slice of people I know of, this was more a rebalancing than a layoff. Sorry, Ms. Bick, I guess I don't know the folks you wrote about.

Also during this time, both Toyota and HP made interesting moves to deal with the impact of the crisis on their business. I pay attention to Toyota thanks to writings like those of Mary Poppendieck's that look at Toyota's approach to empowering its engineering employees to make direct front-line team decisions, sort of like the feature teams various product groups at Microsoft have. And of course, HP is a big Microsoft partner. Both went down the path of avoiding layoffs. Both cut salaries vs. having layoffs, a "shared sacrifice" in Toyota's word (more on Toyota: Japan's management approaches offer lessons for U.S. corporations).

Mark Hurd's memo about the HP salary cuts should have been the memo that Ballmer wrote. Why? Because in it Mr. Hurd reviewed how they already had done due diligence to become a lean and mean company, and that further cut-backs didn't make sense. Also - call it a token gesture if you will - he and the executives took the biggest salary cut. Yet he re-emphasized that HP will pay for performance. None of our executives had said anything about taking a cut back, but rather just re-iterating that their SPSA payout will be less because the company's bottom line is suffering just like everyone else in this crisis. But zero details other than "significantly less."

Winking while we stuff our pockets AIG-style.

So yes, HP will have restructuring, but they don't have 3,600 additional cuts hanging over people's heads.

Do you think that the concept of shared sacrifice would work at Microsoft? If it still felt like a company driven by the employees, probably so. That's my perspective. I think if we still felt like the drive and ambition of the front-line employees shaped the company and defined it, then helping one another would make sense. But the huge growth shattered that sense of employee ownership, abetted by the abysmal Microsoft stock performance we've had since, yes, Mr. Ballmer became CEO. With that all these layers and organizational obstacles spread about and it went from a different, special place for crazy-happy geeks to a jay-oh-bee.

Mr. Mundie recently reflected on a number of topics. One idea was the desire for Microsofties to move around in the company more effectively. I love it. If someone, like, oh, our Senior VP of HR, was to take a moment and muse, "Now's a great time to go back to basics and focus on what it is to be a Microsoftie" one of the keystones should be job movement through the company as part of following your passion and ambition. Maybe it was easier to take risks, be bold, and honestly do what the hell you really wanted to back in the mythic days of FYIFV. And gee, guess what? What do you get when you have people doing what they want to do? Great results.

Obviously we've got about zero job movement right now, so that has to be fixed first. Microsoft gorged itself at the buffet bar of mediocre hires. And now we're bursting at the seams and deadlocked. We are stagnant right when we have two major product releases coming in for landing - Windows and Office - and you'd like those people to be ready to move around Microsoft and cross-pollinate good engineering. Especially those responsible for the obvious success of Win7. Maybe some movement will happen within Windows and Office themselves, but not across the company and probably not into their groups from other parts of the company. Hell, you have people in Windows worried that the Senior Leadership Team is waiting for them to get to a safe RTM harbor so that the 3,600 quota can start getting taken care of. Do you expect people to look around - to take risks - in that environment?

FMIWIWFV!

Zero attrition. Stagnation. Organizational constipation. Nothing good comes out of that but corporate sepsis. Given that our leadership team has had their cage rattled by the global crisis, has examined all sorts of horrible past economic situations, and has locked down on the hiring and gotten on-board with some odd variant of firing, you'd expect they are playing out the forward-looking implications for the product groups and other Microsoft divisions, right?

I'd hope so. But it's not based in any sort confidence based on past results. And it's certainly not based on our leadership engaging with us as we work and live through this crisis. Things are certainly uncomfortably quiet. It's the worst side of "best of times, worst of times" but one hell of an opportunity for re-birth and re-engagement and truly building a stronger Microsoft. A few challenges and opportunities I'm thinking of ahead of Microsoft:

EU: you say "ee-you", I say, "ewwww!" As long as the Microsoft ATM continues shooting out cash fines the EU is going to keep mashing our buttons. Kudos to the folks in Office for demonstrating foresight to jump on documenting their file formats and protocols, even enduring the inevitable attrition such onerous work forced upon the team and the delays to O14 it caused. I'd say, at the end of the day, this saved a large chunk of a billion dollars in fines that the EU would have gone after. You talk about people who deserve to be in The Circle of Excellence? If they head off another EU money-hunt, it's the O14 crew. And good job, Win7, in making IE8 removable. Now, what's the next EU target?

Review Reset: as organizations look to clear out the recent mediocre hires to make room to hire excellent people suddenly really interested in working at Microsoft, middle management is discovering that the review tools have really screwed them over. Told you. To keep everything clear and accounted for, I spend four times the amount of energy dealing with the new review tools through the entire year to get the same results before with the Word form. The current system is wasteful. If it can't be modified to spit out some fixed commitments based on your level, it should be replaced with the old simple Word form.

Free Radical Career: I'm pondering ideas about making employees more mobile within Microsoft. The one I've come up recently is to let anyone who has reached a certain career achievement (Exceeded/20, or just in the top 20%) to be free to move to another part of the company and to have their headcount and associated budget go with them. E.g., the destination team doesn't even have to have open headcount, they just have to be willing to have this new (great) employee come over and join. Okay, they do have to have office space. Sucks for the former team, great for the new team. I know, my first worry there is that you get one crazy charismatic leader and suddenly everyone is working on BoonDoggle '12. But my goal is that if you're great, you can literally write your own ticket to be where you want to be in Microsoft. We need something to break the career stagnation because I know of folks already dorking with their organization is small, petty ways, and remarking, "Well, where are they going to go?"


CRF: Unmoderated comment stream for "Shared Sacrifice and Microsoft Free Radicals"


Press Play

Click: play.

Hoo-boy, things get dusty in the blogosphere pretty quickly. This is a pre-amble post to a regular post to kick things off again here. But in a different way.

While I will start moderating comments again, for most regular posts I'm going to create a shadow unmoderated comment stream post over at the Mini-Microsoft Cutting Room Floor blog (aka, the CRF). Given the comment freeze I put here, some regular commenters found that place pretty quickly. And, well, new readers over at the CRF naturally discovered the entropy that happens rather quickly within an unmoderated comment stream. Yeah, welcome to what I had to read everyday and discard.

Around moderation here:

  1. I'm going to boost up moderation. If you think your comment is the least bit iffy, you'd best post at least a copy over at the CRF, too, unless you want to see those bits disappear into the grand bit-bucket in the sky.
  2. I'm not going to be particularly predictable about when I get around to moderating.

For those that care, let me share where I am with respect to this small corner of cyberspace.

Soon to be five years ago, I started this blog up because I felt Microsoft was a train not only off-track but also heading straight for a cliff. We were massively expanding and incapable of dealing with the exponential complexity that a fast growing Microsoft required of us. It appeared as though we were growing for growth's sake and without a particular elegant plan in mind. So I spoke up within the public wilderness of the blogosphere to ask, "Err, isn't this crazy?"

And. We. Just. Kept. Growing.

Microsoft dramatically changed. The stock price remained flat, with the occasional plunge downwards when our CEO said something that spooked investors or when a surprise $2,000,000,000 investment popped up. We burned billions upon billions of dollars into a game console, to which people say, "At least it has improved Microsoft's image." Okay, step one: don't have a bad image.

Early 2009, we publically reached that cliff and went flying off. There were way too many people on the train to let it brake in time and we had to boot a bunch of them out, old-school layoff style. Folks asked me, "Well, aren't you happy now, Mini? Microsoft is finally cutting back on people!" and I just have to say, "Excuse me, I'm too busy screaming my fool head off as we fly off this cliff."

Now leadership can say, "You know, that multi-billion dollar budget growth year-over-year just wasn't sustainable. We all knew that." D'oh'pe slap for that. After this, I had a stark realization that for all the publicity this blog has garnered and the awkward questions it forced to be asked, none of it helped to avoid that cliff we've been steaming towards the last five years. My reality check has been cashed.

<<edit: cutting out a bunch of blah-blah-blah-me-me-me stuff>>

In what seems quite appropriate for now, I'm stepping back in medium-sized way and letting this be an occasional hobby vs. an initiative. For what it's worth, I'll pick up the Twitter-ing over at http://twitter.com/whodapunk (fingers crossed they are more enlightened than Facebook and don't get stealing what could be my new bucket). See you here and there.


Wednesday, March 11, 2009

MSA - MSPoll Closing Soon

Microsoftie Service Announcement - the MS Poll is closing soon so put some time on your calendar to go through and share your opinions and insight.

Some advice:

  • In all the groups I've been in, the Poll results are poured over all the way down to the front-line manager level. This stuff matters.
  • Don't punish your local team for decisions out of their scope of influence. For 99.9% of you, your manager didn't have any say in the recent layoffs. Judge them and your team and your VP based on what they are actually responsible for, not for the company as a whole. There's an area for that later.
  • Happy with your team? It is just as important that your participate so that your happiness is reflected in your group's numbers so that they can keep doing what they are doing right vs. being told they need to change.
  • Yes, people do read the text comments at the end. But you can easily erase any good feedback and have the bit flipped on your comments with one small snark.
  • No manager feedback this year? Well, here's your chance to bubble up that feedback.

Unmoderated comment post to go along with this quick reminder: Mini-Microsoft Cutting Room Floor Pause Place to be Refresh - MSPoll etc


Wednesday, February 4, 2009

Time To Take a Mini-Microsoft Pause

It's time again for me to press the Big Blog Pause button.

I've put up a post over on the Cutting Room Floor for you to share any comments and ideas you have in the meantime.

Right now, I'm going through a long building change in perspective and simply reconsidering where I want to focus my energy and spare time (hint: writing, but not here). Also, you can only bang your head on the wall for so long without something getting knocked loose that probably needs to be put back in place.

(Is this pause layoff related? Sorry to disappoint the Just Deserves club out there, but, no, I'm not in the 1,400 and I can't imagine my group being touched by the remaining 3,600.)

Getting back to focus, I have lots of forward looking thoughts and it's interesting to me in how few of them I imagine myself at Microsoft for the long-term, let alone mid-term. Four years ago that would be unimaginable heresy. Now: well, in my opinion, the company has fumbled and tumbled into an awkward future with little sense of rigor and spoiled by the abundant cash of Windows and Office. Windows survived Vista and it looks like Sinofsky/DeVaan have a Winning 7 to make amends. Hope. Enough?

I love my team. And I like Microsoft, but I can't say I love it anymore. And that makes me channel Arsenio Hall and go... "Hmmmmmm."

BillG is long gone. Within our leadership, there's no one left who wants to read your ThinkWeek paper, so they're killing that off. In our future, employee-led innovation, I guess, starts at Level 68.

Microsoft needs a back-to-basics ground shaking rebalancing. And that's not going to happen with the current Senior Leadership Team.

I'll certainly be back in time for the next quarterly results, along with any major Microsoft events. You're welcome to send me email in the meantime, but note that I'll be pretty intermittent in checking it (and even worse at replying). During the pause, I intend to go through some of the recent gems within the comments here and ensure they get proper attention.

Over time. Cheers.

Click.