Category: Blog

  • T-SQL Tuesday #30 – Ethics

    TSQL2sDay150x150This month the topic is hosted by Chris Shaw, and his topic is ethics.

    The blog party is the second Tuesday of each month. There is a theme and it is hosted by a different blogger every month. I’ve got a complete list of topics on my blog if you want to read about the past entries.

    It was started by Adam Machanic and if you want to host one, let him know. It can be fun, though a little busy as you compile a summary of the posts from the month.

    Ethics

    I thought this was a great topic, and I’ve actually written on it before. Chris asks a few questions about ethics and they are good ones. I’d like to think that most people have a good code of ethics, but I also think many people haven’t really thought through what their ethics are on this situation. You should do your job, and do what you’re told, but I think breaking the law, or performing an action that violates your moral principles is a no-no.

    However when you get into more subtle issues, like the one Chris talks about with regard to security, what do you do?

    Overall you have to follow your moral compass and use The Test.

    • If you have any doubt about what you’ve been asked to do, seek a second opinion, and get a confirmation from your boss (or their boss) in writing.
    • If you are sure it’s wrong, don’t do it, give you reasons, and let them get someone else to do it.
    • If it’s illegal, you should report it.

    I know sometimes this puts you in a bad situation, and you may fear for your job. That’s natural, and understandable, especially if you are the sole breadwinner for your family.

    However you also have to live with your actions, and they reflect on your soul daily. I would ask that you make the right decision, even when it’s not the most popular, profitable, or palatable one.

  • Finding the Default Trace File

    A post more for me than for anyone else, since I’ll look for something in the default trace and I often need this snippet of code:

    select path 
     from sys.traces 
     where is_default = 1
     

    That returns something like this:

    path

    ————————————————————————-

    C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log\log_92.trc

    This is the current file being used by the trace, which allows me to then look into the file for some event.

    From here, I usually start running a query like this:

    select 
       e.name as eventclass
     , t.textdata
     , t.starttime
     , t.error 
     , t.hostname
     , t.ntusername
     , t.ntdomainname
     , t.clientprocessid
     , t.applicationname
     , t.loginname
     , t.spid
     from fn_trace_gettable('C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log\log_92.trc', default) t
      inner join sys.trace_events e 
         on t.eventclass = e.trace_event_id 
      where eventclass = xx

    In this query, I take the output from the first query and use that as the FROM file and then include an event class number in the WHERE clause. I needed this today, running a check for the latest DBCC, and so I used the class 116.

    You can get a list of event classes here: Trace Event Classes

  • Living a Dream

    It was a little over a year ago that I stood on stage at the Rocky Mountain Tech Trifecta and gave a keynote speech in which I said these words:

    “My wife works in the mobility/cellular phone industry right now, but she really wants to train horses for a living.  In the short term, which might be the next few years, she’s a little "stuck" in her current job. However we spend time and money every year improving her skills, and I support her in doing the "professional development" she needs to do in order to be a horse trainer some day. I know she’ll get there at some point, and I am sure she’ll be ready for her next career with all the work and training she is doing now.”

    As I write this today, my wife is finishing her last day of work in corporate America. She resigned a month ago, and today, May 4th, is her last day working for her company. She had a farewell dinner with her boss last night. She is packing up her equipment and shipping it back. She’s having final calls with co-workers and saying good-bye.

    Her dream has been to work with horses for a living. She has been working part time for years boarding and training horses and people to work with them, and we’ve been working for years to try and adjust our life so she could work on her dream full time.

    That starts tonight, as one job ends and she commits to building her business full time, and with a passion that amazes me. I have no doubt this will be a success for her, and for our family.

    We know there will be an adjustment, and finances will get tighter, but we all think it’s a trade that is worth making. Life is short, very short, and you only get to live it once. We have lost a number of friends in the last year, all too young to leave this Earth, and it’s helped to make us realize that it’s important we don’t delay this change any longer than we need to, even if it’s uncomfortable.

    Life is short, but we never know how short it will be for each of us. Any of us could leave this life at any time. Remember that each day, as you choose your path in life.

  • Patience

    Update: This is confirmed by Snopes.

    A NYC Taxi driver wrote:

    I arrived at the address and honked the horn. After waiting a few minutes I honked again. Since this was going to be my last ride of my shift I thought about just driving away, but instead I put the car in park and walked up to the door and knocked.. ‘Just a minute’, answered a frail, elderly voice. I could hear something being dragged across the floor.

    After a long pause, the door opened. A small woman in her 90’s stood before me. She was wearing a print dress and a pillbox hat with a veil pinned on it, like somebody out of a 1940’s movie.

    By her side was a small nylon suitcase. The apartment looked as if no one had lived in it for years. All the furniture was covered with sheets.

    There were no clocks on the walls, no knickknacks or utensils on the counters. In the corner was a cardboard
    box filled with photos and glassware.

    ‘Would you carry my bag out to the car?’ she said. I took the suitcase to the cab, then returned to assist the woman.

    She took my arm and we walked slowly toward the curb.

    She kept thanking me for my kindness. ‘It’s nothing’, I told her.. ‘I just try to treat my passengers the way I would want my mother to be treated.’

    ‘Oh, you’re such a good boy, she said. When we got in the cab, she gave me an address and then asked, ‘Could you drive
    through downtown?’

    ‘It’s not the shortest way,’ I answered quickly..

    ‘Oh, I don’t mind,’ she said. ‘I’m in no hurry. I’m on my way to a hospice.

    I looked in the rear-view mirror. Her eyes were glistening. ‘I don’t have any family left,’ she continued in a soft voice..’The doctor says I don’t have very long.’ I quietly reached over and shut off the meter.

    ‘What route would you like me to take?’ I asked.

    For the next two hours, we drove through the city. She showed me the building where she had once worked as an elevator operator.

    We drove through the neighborhood where she and her husband had lived when they were newlyweds She had me pull up in front of a furniture warehouse that had once been a ballroom where she had gone dancing as a girl.

    Sometimes she’d ask me to slow in front of a particular building or corner and would sit staring into the darkness, saying nothing.

    As the first hint of sun was creasing the horizon, she suddenly said, ‘I’m tired.Let’s go now’.
    We drove in silence to the address she had given me. It was a low building, like a small convalescent home, with a driveway that passed under a portico.

    Two orderlies came out to the cab as soon as we pulled up. They were solicitous and intent, watching her every move.
    They must have been expecting her.

    I opened the trunk and took the small suitcase to the door. The woman was already seated in a wheelchair.

    ‘How much do I owe you?’ She asked, reaching into her purse.

    ‘Nothing,’ I said

    ‘You have to make a living,’ she answered.

    ‘There are other passengers,’ I responded.

    Almost without thinking, I bent and gave her a hug.She held onto me tightly.

    ‘You gave an old woman a little moment of joy,’ she said. ‘Thank you.’

    I squeezed her hand, and then walked into the dim morning light.. Behind me, a door shut.It was the sound of the closing of a life..

    I didn’t pick up any more passengers that shift. I drove aimlessly lost in thought. For the rest of that day,I could hardly talk.What if that woman had gotten an angry driver,or one who was impatient to end his shift? What if I had refused to take the run, or had honked once, then driven away?

    On a quick review, I don’t think that I have done anything more important in my life.

    We’re conditioned to think that our lives revolve around great moments.

    But great moments often catch us unaware-beautifully wrapped in what others may consider a small one.

    ==========

    I saw this on Facebook, no attribution. I’m not sure it’s a real story, meaning true, but it’s a great one. One that makes me think about life, and how short it can be.