THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

Rob Farley

Rob Farley - Owner/Principal with LobsterPot Solutions (a MS Gold Partner consulting firm), Microsoft MVP (SQL Server) and leader of the SQL User Group in Adelaide, Australia

  • Something for everyone at the SQLBits Training Day

    Of course, the one not to miss is the one I’m doing, on Fixing Queries with Advanced T-SQL Techniques, but actually, they’re all excellent.

    For example, Simon’s just blogged that Buck Woody’s seminar topic has changed. Instead of being on career development, it’s now on DBA skills for the non-DBA. This is a seminar that every .Net developer and Windows admin should be on. I can think of many sysadmins and helpdesk operators who should be sitting in the room listening to Buck explain this material. It’s the type of event that whole teams should attend, and I hope that dev shops from all around the UK (and beyond) will take advantage of this.

    The Virtualisation day from Brent Ozar is amazingly relevant for just about everyone as well, considering that everyone wants to know about whether virtualisation is worth embracing or not. I’ve had plenty of clients ask me just that in the past year or two, and I would happily send people to Brent’s day to learn from one of the best.

    Another topic of massive interest has to be Chris Webb’s day on tuning SSAS. I taught Chris’ MDX course in Adelaide recently (and will do so again in the not-too-distant future), and I can happily attest to Chris’ expertise in this area. With an increasing number of people venturing into the BI space, this will be a popular talk – as will Chris Testa-O’Neill’s seminar on Reporting Services. Chris is the owner of the Manchester accent heard on the Microsoft eLearning courses about SSRS, and at least if you’re in the room and don’t understand what he’s saying you can put your hand up and ask! (Only joking – Chris’ accent is perfectly understandable. He’s also going to be in Adelaide speaking to my user group in December, which will be a great time!)

    Continuing the fantastic quality, the top-ranked precon from TechEd North America this year is being repeated. Maciej Pilecki’s seminar about SQLOS goes into SQL internals to a depth that few in the world can match. If you’re a DBA wanting to get deeper, then this is for you.

    For database developers, Klaus Aschenbrenner is delving into SQLCLR and Service Broker – areas which I find are still very underappreciated.

    And of course, my seminar, looking at the way that various query constructs translate into plans, and how to improve the way they’re handled. We’ll be looking at all kinds of things, leaving you wishing that you weren’t registered for the rest of SQLBits (because you’ll be wanting to connect back to work to fix up some of your queries). In fact, if you’re coming along to my stuff, feel free to bring some queries, and I’ll see if I can use them in some of my examples. That’ll get you some consulting time thrown into the price of the event.

    So I really think there’s something for everyone. If you’re a database developer and not interested in my one, then do Klaus’, or one of the Chrisses’. If you’re a DBA, then get yourself onto Maciej’s or Brent’s, and get your non-DB colleagues onto Buck’s (and as many of them as you can). Just make sure you’re hanging around for the Friday and Saturday as well for one of the best SQL events in the world.

    I’ll see you there!

    PS: Did I mention that you can get a discount if you register today?

  • Q&A about my SQLBits precon

    I received an email from someone who’s trying to decide whether or not to register for my precon at SQLBits 7 next month. He’s already coming to the event (which should be a given for anyone who can make it), but he was trying to work out a few things about my precon, which is called “Fixing Queries through Advanced T-SQL Techniques”.

    He wrote:

    Hi Rob,
    I'm trying to decide on my SQLBits 7 choices and am looking at your Precon Thursday session hence I had a few questions.
    I've (mostly) administered and developed in sql server for 10 years hence trying to gauge the level / suitablility.
    How much do you go into execution plans?
    Will there be any printed material for the course?
    I find I learn from repetition hence dont want to do a course and forget it all by the next day!
    Is there any reading you suggest?
    Sorry to be fussy, paying from my own pocket not a company training budget you see!

    I don’t think he’s very fussy at all. Paying for training out of your own pocket can be scary. Last thing you want is to feel like it’s a waste. So I replied:

    Hi,

    Execution plans will be a major part of the day. Just about every aspect of the day will look at the effect of various constructs on the plan, as the plan is where many performance issues can be seen.

    As far as printed material is concerned - I wasn't planning on giving much out before the event, because the day will be so focussed on queries and seeing how things are reflected in the plans (and I find this can be much more easily expressed verbally and with hand-waving than in written form). I will certainly provide the queries that are used, but was looking to focus on making you think, not read. The key points will be inserted as comments in the queries, so I do expect that you'll have plenty of material to remind you what was seen once you get back to work - hopefully this will be more useful than giving you notes ahead of time. Plus, I'll always answer emails about the content.

    For reading material, I'd make sure you're familiar with basic execution plan concepts, as that will probably give you an advantage over many of the people in the class. My hope is that you'll leave the day with the skills to be able to evaluate the plans that your queries are producing, and have learned ways to improve them. There is an excellent chapter on Execution Plans in the book "Inside Microsoft® SQL Server(tm) 2005: Query Tuning and Optimization" - but I will also be explaining the key points for those less familiar with plans.

    To really work out if this precon is for you, watch the video from SQLBits V at http://sqlbits.com/Agenda/event5/Designing_for_simplification/default.aspx. If this is stuff that interests you, and you want more (and in particular, looking at real queries), then definitely come along.

    Hope this helps,

    Rob

    And if you (the reader) are trying to decide whether or not to do a precon (particularly mine), then I hope this helps you too. I can’t answer tonight’s questions for the other precon presenters, I can only comment on the type of things that I’ll be covering, but I can thoroughly recommend all of the things on offer. The list of presenters is tremendous, and I think this really helps demonstrate that SQLBits is very much a world-class conference.

  • Managing to get time away

    TSQL2sDay150x150Conference season is coming up, and this means time away from work. Something not quite as trivial as I’d like.

    Now that I have a business of my own, the buck stops with me. I have employees, who I trust completely with my name, my brand, my clients – but that doesn’t reduce the need for people to be able to contact me. In fact, when the business was just me, it was generally a lot easier to get time away, as I had fewer clients hoping for my time.

    Funny thing is, I just had a conversation with one of my staff, saying “And if there are any hassles, just call me – except between 9 and 10 tomorrow morning, because I’ll be presenting to the PASS AppDev Virtual Chapter. I’m doing that twice – once tonight at 9pm, and one tomorrow morning. That’s 7:30am and 7:30pm if you’re in the eastern parts of the USA. So clearly, ‘time away’ is a thing that I already do with frustrating regularity.

    If you ever teach a Microsoft course, you will find a slide that recommends students turn off their phones, suggesting that they can pick up messages during breaks, etc. Except that I’ve generally found that if I suggest this to students, they look at me with horror, as if I don’t understand the importance that they have back at their office. So I don’t do that, and haven’t done it for many years. Instead, I tell people that they’re welcome to leave their phones on, but to bear in mind that phone-calls may bother the other students. I’m also happy to suggest to the students that if they feel incapable of leaving their responsibilities for a few days that they work on that, and find ways to avoid feeling that way.

    My take is the old line “Just because you’re necessary doesn’t mean you’re important”, and I think back to times when I’ve known people afraid to give up their piece of knowledge, which they feel keeps them employed. In fact, this causes them to be a liability, and the company may suffer if they get sick or unavoidably detained.

    The “obvious” answer to being able to get away from a job (for a holiday, training course, sickness or lunch) is automation. But I think it really comes down to doing regular handovers. If you can make sure that you’re never the only person in an organisation who has the required knowledge for something, then you should always be able to get away. Similarly, you work with your colleagues to help them achieve the same. If you don’t, then holidays will be ended with piles of extra work, and you’ll even find yourself being on holiday with the phone ringing. Hopefully when I head over to SQLBits (to present two sessions and a precon), or to the SQLPASS Summit (to present two sessions), or to TechEd Australia (just as a delegate for the first time in five years), I won’t need to be fielding calls (although I imagine that it could well be the case, because I’m describing a situation which I still haven’t quite achieved, and after all, the buck does stop with me).

  • SQLBits pre-con – Fixing Queries with Advanced T-SQL

    I’m giving a pre-con seminar at SQLBits 7 on September 30 this year in York (the Old one, in Yorkshire – similar to the New one, but with different songs). Let me quickly explain a few things about it – to help you persuade your boss to let you attend (and when you’ve done the persuading, go here and pick the “Full Conference” option).

    It’s on the topic of Advanced T-SQL, but from a very practical perspective. I’m not going to be going into the uses of ranking functions or recursive CTEs as I have done with courses I’ve written in the past. Instead, I’ll be spending time looking at a bunch of things that I find most people don’t know about their queries, and show how various things can impact those queries’ execution plans. So it’s not so much Advanced features, but deeper aspects of the T-SQL you already know.

    For example, I’ll look at a query that Denny Cherry and I discussed a while back, and consider how various things could be addressed using aspects of T-SQL such as sorting by aggregated fields with GROUP BY. By considering the impact of something like this, seeing where it can be used safely and where it can’t be used safely, hopefully you will be able to make better decisions about your T-SQL code and the methods you choose to solve problems.

    Why do I want to speak on this topic? After all, it can be a lot of fun to talk about ranking functions or recursive CTEs – that’s functionality that a lot of people don’t really leverage, and it can help solve a lot of problems. But the things that I’m going to cover will help your overall understanding of T-SQL, and give you practical ways to improve a lot of the queries that you’ve written in the past. I will show you how to make your queries simpler, but better.

    I remember one of the first times I explained some of these things to someone. They said “Wow, you’re making me want to go back and reconsider every query I’ve ever written.” That’s the kind of feedback that I’m hoping to get from the attendees.

    Some of the points I’ll make will overlap will things that I covered in my SQLBits talk from last November (as reviewed by Phil Nolan – it was also Ian Russell’s favourite talk), and things that I covered in the 24 Hours of PASS in May (as reviewed by HanSQL). They were both popular talks, and hopefully people who attend the whole day of material will also get a lot out of it.

    Being a pre-con, it does have a cost associated with it (the free event is on the Saturday). But I guess it comes down to the value. If you have a budget for training this year and want to find something to spend it on, then the paid portions of SQLBits (including my seminar of course!) are definitely worthwhile. If you don’t write T-SQL, then maybe one of the Chris’ (Webb or Testa) talks on SSRS or SSAS, or Brent Ozar’s session on Virtualisation could be for you (but be careful – he spells Virtualisation with a Z), or Buck Woody’s session maybe. There are seven to choose from (the others are Klaus and Maciej), and I’m sure they’ll all be excellent.

    So get yourself to sqlbits.com and start planning a trip to Yorkshire.

    I’ve also submitted some sessions for the main conference, so if you’re keen to see more, get up to York for the whole three days of Sep 30 to Oct 2 and be prepared to learn something. Having been a part of SQLBits V in South Wales (also the Old one), I can assure you this is one of the world’s top SQL events and shouldn’t be missed. It’ll also be a highlight for me as my latest year of being an MVP ends on September 30. Hopefully October 1 will bring a renewed award, but if it doesn’t, then this pre-con will be the last thing I do as an MVP.

  • Leaving your comfort zone and standing in front of an audience

    ITSQL2sDay150x150 keep seeming to dip back into the training space with LobsterPot Solutions, and I think this is a good thing. Training is both challenging and rewarding. It’s very different to consulting – the other part of what the company does – but the two disciplines compliment each other very well. LobsterPot doesn’t run public courses, but we do get asked for training from various places, including existing clients, prospective clients, and even other training companies.

    I’m not writing this as an advert for the training that we do, but rather as a reflection on the discipline and why I value it so much.

    When you train people in something, whether it be a technical discipline, ‘soft skills’, or something else, it helps refine your skills in a way that you don’t get just from consulting. And vice-versa – if you’re just teaching, there’s a lot that you’ll miss out on. There are lots of lessons that you simply won’t pick up without real projects in the real world.

    I feel for full-time trainers, partly because a lot of people who “only teach” are criticised for not having real world knowledge – and the same applies to people who have studied but never used their knowledge in a real project. But I also know (including from personal experience) that it’s very easy to get into a rut of doing something in a bad way, and having to stand in front of a different crowd of students quite regularly can force you out of that comfort zone.

    Students will ask questions that you haven’t considered. As you work out explanations for things, you will find aspects that you don’t really understand as well as you thought. And you will be forced to address those issues. Just this week I’m due to teach an MDX course for a client, and it’s forcing me to consider how to address a particular aspect that I feel I haven’t really explored enough. I resolved an issue for this same client using the LinkMember() function, but on Friday I’ll be showing them that LinkMember() is generally less-than-ideal, and that a more thorough solution would be better. The solution that we had put in place using LinkMember() was a quick solution, which got them over a hurdle some time back, so I don’t regret it – I just know that preparing to teach this course has given me an opportunity to consider the drawbacks of that particular aspect.

    Writing courseware can be even more challenging. When you find yourself needing to explain something, you end up discovering those gaps in your knowledge quite easily. And while you may be able to put your head in the sand to a certain degree, it’s definitely very humbling and you generally find yourself doing the necessary research to discover the answers (whereas when consulting, a workaround – like LinkMember() – may often suffice).

    Having said all this, life should be a continual learning process. I hope that everyone reading this would agree that they can think of plenty of things they did in the past, that they would like to go back and do another way. If you can’t think of those things, then perhaps you need to be volunteering to teach people.

  • Getting an Advanced Competency in the Microsoft Partner Network

    A work in progress, I’m sure, as the particular requirements haven’t actually been made clear yet.

    I previously wrote a post about the change from Partner Program to Partner Network, and this follow-up post goes into more information about what’s required for my company to pick up an Advanced Competency.

    The Microsoft Partner Network site contains a document called Value of Earning a Microsoft Competency Guide, which describes all the competencies and how to achieve them. It’s a PDF with 109 pages, but actually there will only be a few of interest to you. The first ten pages are interesting because they cover general things, but if you’re already familiar with the way the Partner Network works, the interesting part is later.

    For me, the Business Intelligence and Data Platform competencies are of interest, so I’m most interested in pages 18 and 19, where it describes how to achieve the BI one, and pages 30 and 31 for Data.

    Here I’m going to look at the two competencies applicable to us at LobsterPot Solutions, although the requirements are very similar for other competencies.

    MCPs

    For the Standard competency in BI, we need two MCPs, each having passed both a BI exam and an exam in a related technology (such as the TS exams for SQL Server, SharePoint, Visio and Virtual Earth). This is a recent change to the competency, because a few months ago a SQL exam such as 70-431 would have sufficed. For LobsterPot this isn’t a problem, as we have enough people for this.

    For the Advanced BI competency, the non-BI related exams don’t come into it. Four MCPs who hold MCITP: BI Developer 2008 are needed (although someone with MCM would count as two – not sure why, as there’s no BI component to MCM).

    For Data, things are slightly easier – only one exam for the Standard competency, and for Advanced a choice of either MCITP: DBA 2008 or MCITP: DBD 2008 for each of the four.

    The biggest impact here is that the four people contributing to the Advanced competency cannot contribute toward any other Advanced competencies. Therefore, to have Advanced in both BI and Data, eight staff members would be needed.

    References

    Customer references are still required. The Standard competency needs three, the Advanced needs five. No problem there.

    Fee

    Like in the Partner Program, there’s a fee involved. But if you want an Advanced competency, the fee is bigger. Hopefully this is worthwhile, but there’s no real problem achieving this, you just write a larger cheque.

    The fee is for Advanced Membership, I don’t think it’s a fee which goes up for each Advanced competency that’s held.

    Assessments

    A new thing for the Partner Network is Business Training and Assessments. Now, either level of competency needs someone to have passed an assessment (or exam) in Licensing. I guess this is to make sure that partners are giving correct advice about licensing, although I think the more accurate answers about licensing will always come from Microsoft themselves.

    And as well as this, someone (or two people for Advanced) needs to have passed a “sales and marketing competency assessment”. I’m not sure what this means, and I’m very curious about it because LobsterPot doesn’t have salespeople. All our work comes from references. I have no problem doing this assessment myself and putting one of my staff through it as well, but it does seem a little strange, and I hope it’s not a hurdle.

    Revenue Commitment

    The other new requirement for the Partner Network is that the Advanced Competencies need a revenue commitment, which is dependent on the competency and the location of the partner. I’m hoping this means that Sydney-based partners have to bring in more revenue than Adelaide-based ones, as the market in Sydney is bigger. It may just mean that Australian partners have different requirements than New Zealand ones.

    This last point is the one that scares me the most. We charge rates that work in the Adelaide market, which I’m sure is different to what works in Sydney. I have no idea how much revenue we will need to commit to, or how it will be measured by Microsoft. Also, I assume that the revenue commitment to achieve both Advanced competencies could be more than we’d like.

    Conclusion

    Our plan at LobsterPot is to have one Advanced Competency (in Business Intelligence) in October as soon as it becomes available. Whilst I don’t yet know all the details, I do know that there will be many companies in our shoes, and I hope that Microsoft make the transition easy enough for companies like ours.

    Disclaimer: Please understand that all the information here is my interpretation of the information contained at http://partner.microsoft.com, which should be considered the authoritative resource on the matter.

  • Changes to the Microsoft Partner Program

    I’ll miss Gold Partner status in the Microsoft Partner Program I think.

    It’s not that my company LobsterPot Solutions will no longer qualify for Gold status, but that the Program is changing. It’s becoming the Microsoft Partner Network instead. These changes are rolling out at the moment, and October 2010 is the day when the big switch is being made. And I should make it clear that I don’t work for Microsoft, and I can’t guarantee that there aren’t mistakes in what I’m writing.

    Goldx4 Under the Partner Program, partners could earn points by having customer references, employing MCPs, and various other things. If you reached 50 points, this meant the Microsoft Certified Partner brand could be used, but if you reached 120 points, the Microsoft Gold Certified Partner brand would apply. For LobsterPot, we enrolled in the program when it became clear we would have the 50 points, but surprisingly quickly reached 120. Within the program, we have “competencies” in Business Intelligence, Data Management, Web Development and in Learning Solutions. But we specialise in the first two. Always happy to provide some Web Development or Training, that’s very much part of the business, but the core is SQL Server.

    Under the Partner Network, the points system is being removed, and the tiers will be put on the Competencies, rather than the overall membership. LobsterPot will no longer be a Gold Certified Partner, but will be a Partner with Advanced Competency. And getting an Advanced Competency is becoming much harder than before.

    There will still be Standard Competencies, which have similar requirements to the current set of competencies under the Partner Program. Typically, these require two MCPs and three Customer References. And the MCPs could contribute to other competencies, so that a two-man shop could easily pick up a number of competencies if they’re working in that area.Image from Partner site

    But the goal will be the Advanced Competencies. These require four MCPs (although an MCM counts as two), and these MCPs must have passed the higher-level certifications such as MCITP or MCPD. Furthermore, these MCPs cannot contribute to more than one Advanced Competency. So to have three Advanced Competencies, twelve different MCPs would be required. The number of customer references required has gone up from three to five. And there are other requirements such as an amount of revenue (dependent on a number of factors which I believe are still unclear).

    Do I like the idea of losing Gold Partner status? No – I think “Microsoft Gold Certified Partner” is a strong brand, and it’s a shame to lose that.

    Do I like the idea of having an Advanced Competency that differentiates LobsterPot from other companies that only have Standard Competencies? Yes! This should mean that potential clients have an easier time of realising that we’re more interested in giving someone a BI solution than giving them a pretty web site – but that we can do both if needed.

    My conclusion is that it’s generally a positive move, but I have had to make a bigger effort to make sure enough of my staff have MCITP, and it’s a shame that we’re not large enough to pick up the Advanced Competency in both BI and Data.

    For more information, please go to http://partner.microsoft.com, which should be regarded as the authority on all this.

  • More presentations coming up

    So the pre-/post-con submission I made for the PASS Summit in November didn’t get picked up (although I’m still hoping to get a regular session or two), but in the meantime, I have other presentations going on.

    Those who participated in the 24 Hours of PASS event last month will know that I was a late inclusion when one of the speakers couldn’t make it. Those sessions are now available for free download (but you need to sign up if you’re not already a PASS member) at http://www.sqlpass.org/LearningCenter/24Hours.aspx – mine was Session 20.

    Late next week, I will be presenting to the chapter in Columbus, Ohio (via LiveMeeting, as it’s a long way to go from Adelaide, a trip which would involve kayaks). I’ll be doing some more investigation into T-SQL techniques, but not the same ones I covered in the 24HOP session. I figure that since I was prepared to do a whole day of stuff, that can easily cover several different User Group presentations without doubling up.

    And then in early August, I’ll be doing another presentation for the PASS AppDev Virtual Chapter. Also via LiveMeeting. I haven’t worked out a topic yet, or even the times of day, but it’s the August 10th gathering.

    So if you enjoyed my 24HOP session (as I hope some of you did), or you were unable to listen because of time zone constraints (it was during the early hours of the morning for most Americans), then why keep your eye out for the links to these sessions and join us.

  • Christian’s book – not just Brent’s

    I like to joke with Christian Bolton (@christianbolton) about the time when he got accused of claiming to have written Brent’s book. Of course, he didn’t write Brent’s book – Brent wrote some of Christian’s. And it’s an excellent book.sql-server-2008-internals-and-troubleshooting-book[1]

    For a start, I should point out that I know several of the authors. Christian’s a great guy who lives about 2 miles from my grandparents. Amongst the other authors, there are fellow Arsenal supporter James Rowland-Jones, presenter-extraordinaire and exceptional (if you vote) DBA Jonathan Kehayias, and some guy called Brent who used to work for a consulting firm which I hope LobsterPot is never like (Brent’s a good friend too). So I’m sure the others that I don’t know (Justin, Cindy & Steven) are great people, and I’ll look forward to meeting them.

    The book concerned is Professional SQL Server 2008 Internals & Troubleshooting, and I have to confess that it sat on my bookshelf for too long waiting to be read – I’d looked through some parts, but not given it a proper read, getting distracted by other things. But it’s actually very good, and not just because I could hear the author’s voices as I read it (making up ‘appropriate’ voices for the authors I didn’t know – who would’ve guessed Cindy sounds Glaswegian!).

    There are definitely a lot of books about SQL Server available in bookshops these days, and it can be hard to pick the better ones. My bookshelf includes books by recognised SQL authors such as Kalen Delaney, Louis Davidson, Paul Nielsen, and others, and Christian’s contribution is certainly not out of place there.

  • PASS Chapter map

    Displaying information on an interactive map really isn’t that hard to do. My friends John & Bronwen have been doing this stuff for ages through their company Soul Solutions, and have done lots of talks about how to do this. They have the ability to take that stuff far beyond what I can, but as it’s a significant aspect of data visualisation, it’s an area in which I like to be fairly fluent.

    I wrote a blog post last month on how to fetch latitude and longitude values for addresses, which I did using PowerShell, but the same technology applies just as easily in any language capable to calling web services (including SSIS, it’s worth noting). I love how simple it is to do this, and being .Net, it’s even very straight forward to make a CLR object that can be called using T-SQL.

    So once I have the latitude and longitude, I can easily get that into my database.

    For example, if I look up an address in Chicago, I might get Lat/Lng as 41.885889, –87.632323. This is the location of PASS HQ. To use this with the spatial type, I can use something like: select geography::STGeomFromText('POINT(-87.632323 41.885889)',4326). And of course, once I have a database with that information, I can easily write some code which can loop through them, adding pushpin images to a Bing Maps Silverlight control.

    And now, PASS have linked to the map I put together on their site. So if you go to http://www.sqlpass.org/PASSChapters.aspx, you can more easily find a chapter location near you (or wherever you want to go).

    Click through to actual page

    This map (not the screenshot of it above) lets you zoom in, switch to aerial, everything you’d expect from a Bing Map, and if you mouse-over the pushpin, you can see some more information about the particular chapter. If you’re a chapter leader, and want to get some information updated, I’m sure you can get that information to me somehow…

  • What makes a great place to work

    Co-incidentally, I’ve been looking for office space for LobsterPot Solutions during the same few days that Luke Hayler (@lukehayler) has asked for my thoughts (okay, he ‘tagged’ me) on what makes a great place to work. He lists People and Environment, and I’m inclined to agree, but with a couple of other things too.

    I have three children. Two of them (both boys) are in school, but my daughter is only two. For the boys’ schools, we quickly realised that what they need most is a feeling of safety. This same principle applies to people in a marriage, or in a work environment. One of the most basic human requirements (just ask Maslow) is this same  feeling of safety. I don’t mean job security, I mean genuine safety. My kids have seen bullying close-up, both by other kids and by teachers, and I’m sure we can all remember having colleagues who are also bullies. This is lousy though, and we need to be able to trust our employers, colleagues and even clients – all the people who surround us. Clients may not be an obvious inclusion on this list, but again, I’m sure we all remember clients who have made us feel “not so safe”. And so I tell my staff I will always go into bat for them – in the same way that I go into bat for my kids. I don’t liken my staff to children, but I certainly recognise that not every staff member feels that they can stand up to a client who doesn’t do the right thing by them. Being the company owner, I feel part of my responsibility is to provide a safe workplace.

    Assuming that this is in place, then by all means, the people are probably the next best aspect. Primarily the colleagues, but also the clients. The enjoyment of a puzzle can be excellent in itself, but if this enjoyment can be shared by interested and enthusiastic colleagues, who will learn from you and help you in return, then the enjoyment can be enhanced significantly. This is also a feature which I hope is encouraged at LobsterPot. As we learn from each other, see new and improved ways of solving problems, we share a journey that wouldn’t be the same with different people. And if there are clients who aren’t a pleasure to work with, then for the sake of my employees, I have no problem with losing them.

    But as for the physical location – this is a tougher aspect. LobsterPot currently doesn’t have a permanent office. It suits us to work largely out of client sites, especially as a significant part of what we do is to help clients learn more about the project they’re undertaking. If we get involved, we want to leave the staff there with skills they didn’t have before, and help them strengthen their existing ones. The downside to working this way is that the company can be fairly nomadic, and not have a permanent physical home. I’ve looked at options for LobsterPot today, from ‘virtual office’ scenarios up to an office in a building that has a pool, spa, gym and sauna on the roof. One end of the market provides somewhere to get some work done (but still no real home), while the other end would be overkill.

    So I don’t think a physical location is necessarily all that important. Any place of work needs to be at least adequate, but I think it’s mostly comes back to the points I’ve made above. Maybe it comes back to 1 Corinthians 13, paraphrased here as “If I give people a free gym membership, and hold meetings in the sauna, but have no respect for my colleagues, then I am only a clanging cymbal...”

    One thing that I should include is a short commute. You need to be able to get back from your workplace to those you love quickly. You might really love your job, but that’s not an excuse to neglect your family. We’ve all (right?) been guilty of staying back in the office to finish stuff off, or spending too long online in the evenings (don’t ask me when I wrote this – I know I’m being hypocritical), but if you have a long commute, then is that really helping your home life? Get home in time to see your kids before they go to bed. Eat with them when you can, read bed-time stories and tuck them in, and sing to them on the potty (but stop this when they become teenagers). Again, something which I try to encourage with my staff.

    The things that make a great place to work are the things that make your home a better place to live, which is about how you are when you’re at home. If you can’t sleep because you’re stressed about work, then that’s a problem. If you don’t like your colleagues, you won’t enjoy going to work. It’ll stop you enjoying people so much, making you grumpy, and not a better spouse or parent. And you have to be home to enjoy your kids, otherwise they might grow up without you.

  • My favourite feature of SQL 2008 R2

    TSQL2sDay150x150Interestingly, my favourite new feature of SQL Server 2008 R2 isn’t any of the obvious things.  You may have read my recent posts about how much I like some of the new Reporting Services features, such as the map control. Or you may have seen my presentation at SQLBits V on StreamInsight, which I think has great potential to change the way many applications handle data (by allowing easier querying of data before it even reaches the database). Next week the Adelaide SQL Server User Group has a session about MDS. There are plenty of really cool things in SQL 2008 R2.

    But actually, nothing that appears in any What’s New lists are my favourite features of this new release.

    My favourite thing about SQL 2008 R2 is in the name. It’s the fact that it is an R2. The same product, just the second version of SQL 2008. This means that people who are currently running SQL 2005 should be able to embrace SQL 2008 now (in its R2 form). I keep hearing the “I’m waiting for SP1” line, except that many organisations seem to have missed that SQL Server 2008 SP1 got released last August.

    There is a healthy paranoia about data that means that many organisations are often very slow to upgrade systems. This is a good thing, despite the fact that it frustrates database professionals like myself, who would like to see clients upgrade to take advantage of new features. But new features aren’t things that can persuade someone to upgrade their currently-working-just-fine-thanks-all-the-same system until many others have tested the waters.

    And this is where R2 can come into play. Technically it’s a new version, yes – but it’s a .5 release. It sorts out a few things, such as Unicode compression, and it adds features that are somewhat peripheral, but on the whole, the product is unchanged – like an overly significant service pack.

    So my hope for R2 is that we see a new influx of organisations adopting it. It’s very good that it wasn’t called SQL Server 2010. That could’ve introduced a renewed paranoia about the stability of the product, with most people waiting for another service pack (or two) before rolling it out. Calling it R2, and acknowledging the lack of differences in the Database Engine and Analysis Services is in many ways, the best feature of SQL Server 2008 R2.

  • Buck Woody in Adelaide via LiveMeeting

    The URL for attendees is https://www.livemeeting.com/cc/usergroups/join?id=ADL1005&role=attend . This meeting is with Buck Woody. If you don’t know who he is, then you ought to find out! He’s a Program Manager at Microsoft on the SQL Server team, and anything else I try to say about him will not do him justice. So it’s great to have him present to the Adelaide SQL Server User Group this week. The talk is on the topic of Data-Tier Applications (new in SQL 2008 R2), and I’m sure it will be a great time.

    Why not join us? Buck will be joining at us 8pm on Monday night (May 24th) in his time zone (US Pacific), which is 4am Tuesday morning (May 25th) in the UK and 12:30pm Tuesday lunchtime (May 25th) here in Adelaide. But if you can come in person, then register using this URL and join us for pizza around noon.

  • Fetching Latitude and Longitude Co-ordinates for Addresses using PowerShell

    Regular readers of my blog (at sqlblog.com – please let me know if you’re reading this elsewhere) may be aware that I’ve been doing more and more with spatial data recently. With the now-available SQL Server 2008 R2 Reporting Services including maps, it’s a topic that interests many people.

    Interestingly though, although many people have plenty of addresses in their various databases (whether they be CRM systems, HR systems or whatever), my experience shows that many people do not store the latitude and longitude co-ordinates for those addresses.

    Luckily, the Bing Maps API provides everything you need!

    Start by going to bingmapsportal.com, logging in using a LiveID and creating an account:

    image

    Then you can create a key using the link on the left. This key will be attached to a website, and looks something like: Apsjm7zVthPFMxlfpQqKhPPZrAupI-_aGH-CvT2b... Now you can use the Bing Maps API to fetch the information you need. Obviously check the terms and conditions to see if you will need to pay for your usage or not. The Bing Maps API works through web services, so it’s easy enough to use almost any system for this. You could easily make a CLR Function for use within T-SQL, but I’m going to show you how to do it using PowerShell.

    Let’s start by creating a Web Service Proxy to the URL of the webservice.

    $ws = New-WebServiceProxy -uri http://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl;

    By passing $ws into Get-Member (using the command: $ws | Get-Member), we can see that there is a Geocode method, which requires a parameter of type GeocodeRequest. Actually, the type to use is much more complicated, but it’s easy to create a variable for it using:

    $wsgr = new-object Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1ervice_geocodeservice_svc_wsdl.GeocodeRequest;

    This variable will take the address to look up in its Query property, but we’ll do that in a moment. First we need to provide credentials, which is that key we created on the website. I’ve stored mine in a variable called $key, so that I don’t have to display it in demonstrations that might be recorded.

    $wsgrc = new-object Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1ervice_geocodeservice_svc_wsdl.Credentials;
    $wsgrc.ApplicationId = $key;
    $wsgr.Credentials = $wsgrc;

    Now when we call the method on our web service, Bing Maps will know that it’s us that have called it.

    Now I can make a request. If I use a single address, I can just use the Query property of the GeocodeRequest object, as I mentioned earlier. When I get my results from the Geocode() call, I can get multiple lines, and each of them has a bunch of useful information including (as I find most useful), the Formatted Address, and location co-ordinates. I can easily display this by passing the Results into a Select-Object call. I’m just handling the first result of each call, as will become clear in a moment.

    $wsgr.Query = 'Adelaide, Australia';
    $wsr = $ws.Geocode($wsgr);
    $wsr.Results[0] | select {$_.Address.FormattedAddress}, {$_.Locations[0].Longitude}, {$_.Locations[0].Latitude};

    As readers familiar with PowerShell will already appreciate, there is a good potential for looping through many addresses. I did this with locations in the world that have PASS chapters recently, but to simplify this, my example uses just four.

    $uglist = 'Adelaide, AU', 'Aukland, NZ', 'South Africa', 'San Deigo, USA';
    $uglist | % {$wsgr.Query = [string] $_; $wsr = $ws.Geocode($wsgr); $wsr.Results[0] | select {$_.Address.FormattedAddress}, {$_.Locations[0].Longitude}, {$_.Locations[0].Latitude};}

    This gives the following results:

    $_.Address.FormattedAddress                           $_.Locations[0].Longitude                $_.Locations[0].Latitude
    ---------------------------                           -------------------------                ------------------------
    Adelaide, Australia                                            138.599731698632                        -34.925769791007
    Auckland, New Zealand                                          174.765734821558                       -36.8473847955465
    South Africa                                                   25.0630002468824                       -29.0459994971752
    San Diego, CA                                                 -117.161724865437                        32.7156852185726

    You’ll notice that the FormattedAddress property shows the address in a standard format. This is great, because it will handle spelling mistakes (see how I left the ‘c’ out of ‘Auckland’ when I wrote it – for me I did this on purpose, but in most user-input systems, spelling mistakes are a common problem), and it will provide a consistency for punctuation, abbreviations, etc. Notice that I used ‘AU’, ‘NZ’ and ‘USA’, which were all transformed into something else in the web-service call.

    With the Lat/Long details here, it’s very simple to get this into a database, or a file, or whatever format is required. For me, I put them into a database along with all the other PASS Chapter locations I had looked up (using the public data from the website), and using the Bing Maps Silverlight control, came up with something like this:

    image

    It was a bit more work to colour the pushpins by the region, and putting tooltips in with extra information, but bridging the gap between a pile of addresses and a map is actually remarkably straight-forward with the Bing Maps API.

  • Spatial data from shapefiles (for T-SQL Tuesday #006)

    I’m giving a presentation on May 12th at the Adelaide .Net User Group, around the topic of spatial data, and in particular, the visualization of said data. Given that it’s about one the larger types, this post should also count towards Michael Coles’ T-SQL Tuesday on BLOB data.

    I wrote recently about my experience with exploded data, but what I didn’t go on to talk about was how using a shapefile like this would translate into a scenario with a much larger number of shapes, such as all the postcode areas in the US and Australia, plus high-level postcodes from the UK or Canada (US and Aus roughly have a postcode per city/suburb, whereas the UK & Canada use a postcode for a much smaller group of addresses, with the city/suburb being typically the first half of the postcode).

    The issue comes down to the fact that the shapefile isn’t filtered. It contains all the shapes. So if you want to display the ones near a point of interest, you’re having to trawl through the lot still. Maybe not what you’re after. So the trick is to use polygons stored in a geography field in SQL, and use that instead. Basically rejecting that “ESRI shapefile” option that Report Builder 3.0 presented. And in particular, put a spatial index on that geography field.

    I could go into a ton of detail about the way that spatial indexes work, about how they apply a grid over the world, and then break the squares that result into smaller squares, until they get into quite some level of detail – but I’ll let you research that through Books Online or the like. I just want to point out that the geography type CAN be indexed, and that this allows you to handle a much larger set of regions without incurring the performance hit that you’d get if you had massive shapefiles.

    Unfortunately, shapefile data isn’t trivial to get into a geography type, but Morten Nielsen has put a great tool together which you can use for this. It works very well indeed.

    In my presentation, I’ll go into a lot more stuff that I’ve learned about shapefiles and the like, but I’ll let you come along and discover that in person. If there’s interest in this stuff, I might even submit a talk on this for some of the upcoming conferences, such as TechEd AU/NZ or PASS.

More Posts Next page »
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement