Author: way0utwest

  • Data Presentation – T-SQL Tuesday #22

    TSQL2sDay150x150It’s T-SQL Tuesday again, with our host this month being Robert Pearl, of Pearl Knowledge Solutions. He chose the topic of Data Presentation for September.

    If you haven’t participated in a T-SQL Tuesday, it’s easy. Read the rules in Robert’s post and read the basic idea in Adam Machanic’s original invittation. Then write a blog post with the logo to the right in it and link it back to Robert’s post.

    That’s it.

    Formatting Data

    One of the things that DBAs and data professionals should learn is that formatting typically doesn’t belong in the database. The client, front end, or the tools used to extract the data should handle formatting, presenting the data as the client wants to see it.

    When you store numbers, you don’t want to store things like currency symbols. So in SQL Server I should see this:

    datapresent1

    and not this:

    datapresent2

    The former gives more flexibility, and the latter limits what you display (and requires character storage).

    The same thing goes for other data, for example, phone numbers. We don’t want to store our phone numbers like this:

    datapresent3

    If someone wants to see just the number, or they add in another format of number (say European), then you have inconsistencies. Also, it becomes harder to separate out issues. When you do separate out the number from the area code, how do you handle things if you have this:

    datapresent4

    That’s hard to handle. If all the phone numbers were numbers, it’s easier to handle. This allows one easy CASE statement based on length.

    datapresent5

    Or better yet, use better design and let the front end handle data presentation.

    datapresent6

    Doing It Right

    I guess I haven’t talked data presentation so much as how not to handle data presentation. I know that SQL Server can do things like ordering, formatting, combining or splitting strings, or more, but ultimately I think that’s not the right way to handle things.

    I’ve always viewed the database as the single bottleneck. It’s incredibly hard, and expensive, to scale a database server, while it’s easier to scale web servers, app servers, and client tools, and much less expensive. It’s even easier to scale developers and have them write more code to handle presentation on the front end instead of using SQL Server to do the work. I’d try to always push any presentation work to the client instead of the database server, just because of the workload and bottleneck on the server.

    It might seem like more work up front, and it will be, but it will be infinitely better than trying to re-write code or upgrade your database server later when the load becomes larger.

  • Fun Networking at the PASS Summit

    Once again I’m a part of two fun events at the 2011 PASS Summit that I hope you’ll join me in attending.

    The Mentoring Experiment – Monday Night

    Andy Warren (LinkedIn | Blog | @sqlandy) and I started The Mentoring Experiment earlier this year as a way to try and help people grow their careers. It has been going well and we’ve rented out Lowell’s in the Pikes Place Market on Monday night from 6pm-9pm. Please feel free to come by and join us.

    Register at EventBrite

    We rented the space, but each person is responsible for their own food and drink. That should not, however, deter you from offering to buy a new friend a drink Winking smile

    The registration is for planning, but even if it shows full, come by if you have time and would like to meet a few fellow Summit attendees.

    The Exceptional DBA Awards Party – Tuesday Night

    For the last eight or nine years, SQLServerCentral has hosted an opening night party, just after the official PASS opening reception. We’ve tried a few things, but settled on a casino themed party for the last 5 or 6 years and it’s been great fun.

    This year we have arranged for it to happen again, and you can join us for some networking fun and also meet the 2011 Exceptional DBA award winner. We will once again have a casino caterer, allowing you to get some virtual “fun” money and enjoy various games. Come join us and have fun with fellow attendees on Tuesday night.

    We will have a cash bar available and there will be lots of random prizes, so try your luck at a few games and you might come home with a fun prize.

    We are selling tickets in advance for $20, or you can bring $30 to the event and pay at the door. Details are below:

    When: Tuesday 11 October 2011, 8-11pm
    Where: PASS Summit, Seattle – Room 2AB, Washington State Convention Center
    Tickets $20 – book yours now via PayPal to sjones@sqlservercentral.com

  • A Walkabout

    A great read. My wife and I considered this at one point.

    At one point when I was in college, I spent a few weeks touring around Europe. I had a bicycle with me, a backpack with a couple changes of clothes, and wandered throughout parts of France, Spain, and Italy, staying in hostels and living a carefree life. However my few weeks were nothing compared to what many students in Australia often do. I met a few dozen students at different times from down under that were on a walkabout from school, traveling around the world for a year, experiencing life on their own terms, far away from home.

    I was somewhat jealous, and I even considered joining them for an extended vacation of my own. I never did, but I’ve always wondered if I should have. My wife and I read One Year Off about seven or eight years ago and debated taking a walkabout the world with our kids, but decided against it. As I’ve gotten older, I’m not sure it’s the way I would want to live my life, but I admire those that can live like that. Personally, I’m not evens sure what I would do on a sabbatical, something that my company, Red Gate Software, has provided to a few of my co-workers.

    James Moore of Red Gate, is combining the idea of a sabbatical away from work with a walkabout in another country. As James looks forward to the future of software tools, he’s decided that reading feature/bug requests and doing customer surveys isn’t enough. James is actually touring the US, meeting with customers, watching their developers in action and trying to learn how database development is evolving in a rapidly changing modern world with cloud services, new version of SQL Server and ever increasingly complex applications.

    I don’t know how this walkabout will turn out, but I think it’s great that my company is actively trying to make sure that they solve the right problems, in the right way, for their customers. I think Red Gate has done a great job in building simple, intuitive, but incredibly useful tools over the last decade and I’m looking forward to seeing what James comes up with after this trip.

    Steve Jones


    The Voice of the DBA Podcasts

  • A Matter of Life or Death

    In this book a data breach, identity theft, causes a death

    It sounds like something out of a fictional story, but could there be a data breach that might result in a person’s death? I read a book recently called Medical error in which a patient dies because of an allergy. The physician checked their records and noted the patient had been prescribed the drug earlier that year at the hospital, administered it, and the patient reacted and died. It turns out the patient was a victim of identity theft and the thief was the one that was seen at the hospital. The thief  didn’t have an allergy, but the victim did and died.

    According to this story, there hasn’t been a case of a data breach resulting in someone’s death, but the recent attacks against law enforcement agencies could change that. Informants and undercover detectives depend on their anonymity. A release of details from active cases could result in a death since the people that would be most interested in the information might be willing to kill those named.

    We seem to have no shortage of people that hack and attack systems for fun, often without much forethought about the potential effects of their exploits. As criminals get more sophisticated, I would expect more attacks to occur against law enforcement agencies. We’ve already had attacks that cross national borders, potentially sponsored by governments and I suspect we will see even more in the future.

    The data professionals working in the industries where life and death are dependent on technology should be worried. In law enforcement and medical fields, data professionals should be constantly educating themselves about security and working to regularly ensure their systems are protected, and audited . Auditing may even be more important in order to respond to breaches quickly.  It is asking a lot, but the potential results from a security lapse could haunt you for a long time if you haven’t done your best.

    Steve Jones


    The Voice of the DBA Podcasts