Category: Editorial

  • Real World T-SQL Tricks

    I’ve been playing more with T-SQL this year, doing some testing and development in various places. I’ve been trying to improve my skills, and keeping up with the advancements the language has made in the last few versions. Like many of you, if I haven’t had the need for a particular feature, or the chance to implement it, I haven’t done much with it.

    I think that’s the case with many people, who may not catch all the changes in T-SQL with new versions, especially if you upgrade after a year or two and don’t often do more than refactor the existing code you have in production. In the spirit of improving skills, and also learning more about how others work in this profession, I want to ask you:

    Have you used any of these T-SQL items in production code?

    • APPLY
    • THROW
    • LAG/LEAD
    • a tally table
    • symmetric or asymmetric keys
    • TRY..CONVERT
    • CONCAT/FORMAT
    • IIF
    • SEQUENCE

    Some of these have been around for a long time, some are new in SQL Server 2012, but they are all improvements beyond the core T-SQL language that I see so many people posting and asking questions about.

    Let us know this week if you’ve used any of these constructs, and if you can, how they solve a problem that you struggled with in the past, or maybe how these new features have improved performance or sped up code development.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 2.0MB) podcast or subscribe to the feed at iTunes and LibSyn.

  • Achievement Unlocked: Balance 0

    Earlier this week I got a notice that I hadn’t completed a task this year. It’s one that I’ve rarely finished in the past, and probably not in any year in the last 10. However I decided this year that I should buckle down and get this done. I’m proud to say that I spent about an hour working on the task and got it done.

    What was the task? Taking all my vacation.

    I’ve got some amazing benefits from Red Gate Software, and my holiday allowance is one of them. However I’ve often struggled to allocate out my time, and with travel and my concerns over keeping this site running, I usually carry over a few days. I often sell a few back as well, and I’m actually glad that there are limits on both of those actions. If left to my own devices, I might become much more unbalanced than I have been in the past.

    I had a couple of weeks left, but to keep SQLServerCentral running in top form and ensure that you are getting information to help you improve your SQL Server skills, I can’t disappear on short notice. As a result, I’ve spread out my time off across the rest of this year and will be absent a number of days in December. Some is real vacation, some are days off that where I’ll have to decide what I want to do with the time.

    I know far too many people in technology skip vacations or don’t plan enough time off. I’ve been trying to get better at this each year, and I’m happy to say that I’ve finally managed to use up all my holiday for 2014. Don’t be like me. Schedule your time off and take it. Recharge, refresh, and enjoy the rest of your life. Remember that you work to live, you don’t live to work.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 2.2MB) podcast or subscribe to the feed at iTunes and LibSyn.

  • The SQL Server Container

    I’ve been hearing about Docker quite a bit lately. It’s a piece of software (and a company) that builds containers that provide isolation for an application, allowing a more lightweight way to separate our applications than virtualization. Right now the containers only run on Linux, but they allow a Docker container running PHP to run on a machine as though it were the only process running on the Linux host. Other Docker containers running on the same host could contain different versions of PHP and not have conflicts. Or you could have multiple versions of MongoDB, MySQL, Java, etc. that provide separation in a much less resource demanding way than virtualization does.

    It makes me think back to the idea of having stripped down, lightweight database machines. We’ve gotten the Windows CORE OS, but I wonder if Microsoft would ever take this a step further and package an even more stripped down Windows OS, with SQL Server embedded in it. Rather than have to install Windows, SQL Server, and then potentially have administrators want to install other software on the host and incur the overhead of sharing resources, could we have a single installation that includes a bare bones, stripped down and optimized Windows/SQL Server combination that only functions as a SQL Server database machine?

    I doubt Microsoft would ever move in that direction, but perhaps they might use a similar concept. It seems the push from Microsoft is for more services and hybrid solutions involving cloud type services. Perhaps smaller companies might want an appliance device that contains a SQL Server, or an application like Dynamics, with hybrid bursting power in the cloud. Certainly containers might make deployment of software easier in a PaaS environment.

    Either way, Docker is coming to Windows, and it’s going to be another tool that developers should consider incorporating into their application development processes.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 2.2MB) podcast or subscribe to the feed at iTunes and LibSyn.

  • MY Data

    Data is merely a set of numbers. However when data is given context, it allows conclusions to be drawn and many of us make a living managing some part of that process every day. Most of us deal with data that is viewed as somewhat public, related to our interactions with businesses and organizations. However we see some of this changing as employers start to gather more data on us through social media and other sources, beginning to use that data to make hiring decisions.

    It can get worse. As Shane Battier says in this article says, “big data is scary.”

    Most of us don’t aren’t hired for our physical performance. While our health can make a difference in how well we write code over time, the regular, subtle decisions of drinking juice or soda don’t affect our performance much on a daily basis. We could argue about that, but from the employer’s perspective, I’m not sure those things matter.

    Or do they? If the cost of employees rises over time, especially with regard to health care or sick time, should employers start to make decisions based on the data? Are we confident in the conclusions from data, which are really probabilities, not actualities? Would you want aspects of your life, perhaps outside of your health (think driving, finance, etc) to be part of the evaluation (or negotiation) process for your employment?

    Perhaps a lighter question, would you be comfortable managing and writing applications that work with employee data and try to analyze, perhaps even strongly recommend, changes in peoples’ live? I’m not sure I would, and I certainly hope we don’t get to the point where the data about our personal lives directly impacts the way we are managed.

    Steve Jones

     

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 2.1MB) podcast or subscribe to the feed at iTunes and LibSyn.