T-SQL Tuesday #020 – T-SQL Best Practices

Invitation and summary from Amit Banerjee.

What is the topic for July?

The topic for July is “T-SQL Best Practices”. If you work with SQL Server, then undoubtedly you would have had to write T-SQL queries atleast once or would have had to debug the seemingly useful piece of T-SQL code written by your developers to find out where the performance bottleneck or problem was. Your post for this month’s revolving blog party could be along one of the areas:

a. A set of T-SQL best practices that you follow in your shop that or you believe that should be followed always. It could be as specific as for writing only linked server queries or writing queries for SSIS packages etc.
b. An issue that you resolved because certain T-SQL best practices were not followed.
c. A workaround that you used (like query hints) to resolve an issue where T-SQL best practices couldn’t be implemented due to involvement of a third party solution.

Why did I choose this topic?

Over the years of troubleshooting SQL performance related issues, I have found on multiple occasions that the T-SQL query in question was performing badly because certain best practices for writing that piece of code were not followed and the one responsible for the development had not foreseen that such an oversight could become a bottleneck when the data or the number of users increased. So, I thought it would be a good idea to get the SQL Community’s thoughts around best practices in this area. Sometimes, the most obvious things are the easiest to overlook!

T-SQL Tuesday #019 – Disasters and Recovery

Invitation and wrapup from Allen Kinsel.

Disasters

Its the first week of June and for those of us living along the Gulf and Atlantic coasts of the US, that brings the beginning of hurricane season.  It also means its time for this months installment of T-SQL Tuesday.

This Months Topic

Hurricane Ike dead ahead

There goes your weekend/month

Disaster Recovery.  This topic is very near and dear to me based on the fact that I live on a barrier island that was the site to the deadliest natural disaster in US history and more recently destroyed by the third costliest hurricane in history.  Needless to say preparing for disasters is nearly instinctive to me which might explain why I’m a DBA but I digress.  Anything you’d like to blog about related to preparing for or recovering from a disaster would be fair game, have a great tip you use to keep backups and recovers running smoothly, a horrific story of recovery gone wrong? or anything else related to keeping your systems online during calamity.  We want to hear it!

T-SQL Tuesday #018 – CTEs

Invitation and wrapup from Bob Pusateri.

The Topic

This month’s topic is CTEs, or Common Table Expressions. Had you asked me 10 years ago what CTE meant, I would have replied “coefficient of thermal expansion” but that was back in my semiconductor & electronic materials phase. I like the database version much better 🙂

Have you ever solved or created a problem by using CTEs? Got a tip, trick, or something nifty to share? I’d love to see your posts about any of the above. Also don’t forget that T-SQL Tuesday is not limited to only T-SQL:

“Any post that is related to both SQL Server and the theme is fair game. So feel free to post about SSIS, SSRS, Java integration, or whatever other technologies you’re working with in conjunction with SQL Server. Even if your post includes no T-SQL we still want to see it.”

T-SQL Tuesday #017 – APPLY Knowledge

Site list, but invitation below from Matt Velic.

APPLY Knowledge

Recently on Twitter, I heard the claim that “If you don’t understand the APPLY operator, your skills are somewhere around the 50th percentile at best.” While I believe that Adam was giving a warning to self-proclaimed experts (possibly one he might have been interviewing at the time…), I also believe that we could take it as a challenge as a T-SQL blogging community to learn more about APPLY and the ways in which we can use it in our work.

Please share how you use this wonderful feature. Maybe you know how APPLY works inside and out? Perhaps you’ve got a fantastic user defined function (UDF) to share? Or maybe your experience revolves around using Dynamic Management Functions (DMFs) in your never-ending quest for SQL Server performance? Let the community know as it is time to study!

T-SQL Tuesday #016 – Aggregate Functions

Invitation and SUM() from Jes Borland.

The Topic: Aggregation

No, not aggravation (although I’ve used the two interchangably before). I want to hear how you solved business problems with aggregate functions. I want to see your cool T-SQL tricks. How are aggregates used in SSRS, SSAS, or SSIS? What have you learned about aggregate functions?

Let’s SUM(thoughts), COUNT(ways we’ve done things), and set MAX(awesome) on our posts!

Remember: “any post that is related to both SQL Server and the theme is fair game. So feel free to post about SSIS, SSRS, Java integration, or whatever other technologies you’re working with in conjunction with SQL Server. Even if your post includes no T-SQL we still want to see it.”

T-SQL Tuesday #015 – Automation in SQL Server

Invitation and Summary from Pat Wright.

Having taken part in several T-SQL Tuesday’s I decided I would finally put my name in to host one.  I figured it would be a good way to lose my sanity learn some great ideas from this wonderful SQL community.  I figured that since many of you out there set a goal this year to blog more and to learn Powershell then this Topic should help in both of those goals.    So the topic I have chosen for this month is Automation!   It can be Automation with T-SQL or with Powershell or a mix of both.  Give us your best tips/tricks and ideas for making our lives easier through Automation.  Now here are all the details you’ll need for a successful T-SQL Tuesday post!

T-SQL Tuesday #014 – RESOLUTIONS

Invitation and summary from Sean McCown.

OK, it’s time for TSQLTuesday again and Jen’s making me write something since we’re hosting this month.  So the topic is resolutions, and that in itself isn’t a topic that’s near and dear to me because frankly I just don’t believe in them.  I don’t think you have to wait until a new year begins to resolve to do something you’ve been meaning to do.  In fact, that pretty much dooms you to not completing it because it takes more than the turning of a calendar page and a romantic notion to accomplish something.  If it were really that easy, you would have done it already so it wouldn’t be a big deal.

Your new year can start anytime really.  Hell, doing a new year’s resolution doesn’t even line up with my review period at work, so if I relied on the new year to start something new I’d lose 3mos making good on what I’m supposed to accomplish for work.  People in IT quite often put personal goals in their yearly goals at work.  Things like getting certified, or perfecting a process, or taking management classes, etc are all things that are commonly found in your yearly goals at work.  So if you’re going to make some kind of resolution to do something, or to stop doing something, why not put it where it actually makes more sense… in your work goals.  Your bonus quite often relies on you completing your goals so it’s really the perfect place.  And it gives you a better excuse to have the resolution to begin with because you can use the bonus as motivation.

So even if you’re going to make a resolution at work, try to make it something you can actually do.  One of the biggest reasons for failure is someone will set a goal that’s completely ridiculous for them and when the goal starts slipping they get discouraged and just give up.  I’d like to get my MCM this year, but I don’t even have any of the lower certs yet.  Well, chances are you’re not going to make it dude.

2010 T-SQL Tuesdays

T-SQL Tuesday #13 – What the Business Says Is Not What the Business Wants

Invitation and roundup from Steve Jones.

I was giving a presentation recently and someone in the audience started to ask about why I recommended against a certain technique. Without getting into it, this person kept saying that she had to implement things her way since the “business” said they needed it done that way. However a little digging showed that the business didn’t really understand the technology. They were asking for a result, and she took them literally in how she implemented a process. A classic impedance mismatch.

I think we’ve all had situations that are similar. The business, the client, the customer, is asking for something, but they don’t know how to ask those of us building the technology. Or they don’t understand the implications of asking for something like “absolutely zero data loss” to be implemented.

The official topic this month is:

What issues have you had in interacting with the business to get your job done.

T-SQL Tuesday #012 – Why are DBA skills necessary?

Invitation and summary from Paul Randal.

Invitation to participate in T-SQL Tuesday #12 – Why are DBA skills necessary?

This month I’d like to step back from the deep technical stuff and ask “why are DBA skills necessary?”

I don’t want to color people’s opinions by giving my own yet, but some things to consider are:

  • What problems have you seen in your career that could have been avoided with some DBA skills?
  • At what point does a SQL Server installation need a real DBA to look after it?
  • How could DBA input help prevent design problems in data applications?
  • Should there be cross-over been developer skills and DBA skills? What about architects? Storage admins?
  • How can business continuity be affected by lack of DBA skills?
  • How much can we rely on auto-tuning to ensure performant work loads?
  • Is Microsoft doing enough to foster DBA skills as a point of excellence?
  • What about on other RDBMS platforms? What about no-SQL?

I could go on for hours… I’m really looking forward to seeing where you take this topic and I’m expecting some great posts.