T-SQL & Development
Get Your Blog Posts Ready for T-SQL Tuesday #200. Here’s the Topic.
Way back in December of 2009, Adam Machanic published a blog post (archive) in which he invited database bloggers to participate in a new monthly event he called T-SQL Tuesday. Each month, he (or a blogger he picked) proposed a topic, and on that date, we’d all publish our blog posts at the same time. It was a fun way to get a variety of opinions about a topic.
T-SQL Tuesday has been going strong for over a decade, but a lot has changed. Adam’s original blog site is gone, there’s a new archive of the monthly posts, and Steve Jones has taken over coordinating the event. If you’ve got a spare afternoon, going through the archives is a fun way to learn a lot about topics – everything from Extended Events, date/time handling, windowing functions, encryption, and more.

Our industry has changed a lot in that time span, too.
But you know what hasn’t changed?
There are still a ton of readers out there who need help with T-SQL.
And that’s where you come in, dear reader. If you’ve got a blog, even if you haven’t written a post since the pandemic, even if you’ve moved on to other technologies, if you’re reading this post, you’ve got something to offer the countless readers who are just getting started on their database journeys today.
Here’s your topic:
“When I’m looking at a query, I bet it’s bad if I see ____.”
I bet just reading that sentence, you had a knee-jerk reaction or three. You think about opening up a report query, a stored procedure, a function, trigger, or EF code, and when you see that one thing, you go, “Oh no, this was probably written by That One Person™, and they were probably using AI, and I’m gonna dread reading the rest of this and I’m gonna have to fix it myself because the whole query is probably a hot mess.”
Take that knee-jerk reaction, go over to your blog, log in, and write a few paragraphs about why you don’t like seeing _____ in production code, the problem that it’s caused you in the past, and what you recommend instead. Don’t second guess yourself, and don’t think, “Well, somebody else is surely going to write about ____, because everybody knows that’s bad.” First off, they don’t! You would not believe the misguided queries I see at work every day. Second, if a bunch of bloggers chime in with the exact same hot button feeling, that’s GREAT, because it illustrates to the audience how bad that particular thing is.
Don’t be intimidated. Your target audience isn’t me, Kendra Little, and Erik Darling. Your target audience is 2004 Brent, the guy who had never been to a formal SQL Server training class in his life, and who, when he needed to write a new query, opened up some other query written by someone else earlier, copy/pasted it, and started from there without really understanding what he was inheriting. Trust me, no matter what you’re warning 2004 Brent about, he’s going to be surprised, embarrassed because it’s in his own code today, and he’s gonna read your post carefully to take copious notes.
Schedule your post to go live on July 7th or 14th, include #tsql2sday in the title, and include the image at right. Include a link back to this blog post, or come back here and leave a comment linking to your blog post. One week later, I’ll publish a roundup blog post linking to everyone’s opinions.
Thank you in advance for continuing to dedicate your time to improving everybody else’s experience in getting started on their database journeys. It’s people like you that have helped us all move our skills forward over the last 100 months, and will continue to keep moving things forward over the years to come.
Free, 3× a week
Get my new posts by email
Three posts a week, plus a Monday roundup of the best database news from around the web.
[…] Each month, a different host chooses a topic for discussion. This month, we have Brent Ozar ( blog | social media ) asking us “if [we’re] looking at a query, it’s bad if [we] see…“ […]
Correlated subqueries. Usually multiple ones across the same table, all of which could have been resolved by a join.
[…] anniversary edition is hosted by Brent Ozar. And his chose topic is: query red flags. Things that make you groan when you open a query and see them in the code. I’m sure there will […]
T-SQL Tuesday #200 — I bet a query it’s bad if I see…
https://medium.com/riccardo-perico/t-sql-tuesday-200-i-bet-a-query-its-bad-if-i-see-c27392e7cd7a
Hi Brent,
Thanks for hosting this month’s T-SQL Tuesday!
Here’s my contribution:
https://vladdba.com/2026/07/07/t-sql-tuesday-200-things-that-make-a-query-is/
Oops, looks like I messed up the slug.
Sorry about that.
Here’s the correct URL:
https://vladdba.com/2026/07/07/t-sql-tuesday-200-things-that-make-a-query-bad/
[…] post is part of T-SQL Tuesday #200, hosted this month by Brent Ozar. The prompt: “When I’m looking at a query, I bet […]
My first T-SQL Tuesday on my relatively new blog
https://dualcoredba.com/2026/07/07/tsql2sday-200/
Got it! Good to see you blogging. Do you want me to credit you by name, or by DualCoreDBA? I noticed that you didn’t have your name on the site.
Woop, exciting!
Please use DualCoreDBA
https://sqlreitse.com/2026/07/07/t-sql-tuesday-200-when-i-look-at-a-query/
[…] month is hosted by Brent Ozar who asks participants to think about “When I’m looking at a query, I bet it’s bad if I see ____.” I liked what he wrote around that, asking readers to consider their gut reactions and use that for […]
Hey Brent – thanks for hosting! Here’s my contribution. Cheers!
https://sqlbek.wordpress.com/2026/07/07/t-sql-tuesday-200-i-bet-a-query-is-bad-when/
Got it, thanks!
Hi Brent, thanks for the invitation.
Here’s my post: https://straightforwardsql.com/posts/tsql-tuesday-200-red-flags/
I’m surprised you were the first to mention AI!
Here is mine.
https://sqlserverfast.com/blog/hugo/2026/07/t-sql-tuesday-200-query-red-flags/
Ooo, yes, I’ve never thought about that one, and it instantly raises a red flag!
Whoops, sorry for the duplicate. I didn’t see in time that there’s already a pingback.
In case the link back to this post didn’t work
Here’s my blogpost: https://www.martinguth.de/performance-tuning/tsql2sday-when-the-optimizer-runs-out-of-time/
Good post!
https://advancedsqlpuzzles.com/2026/07/07/i-know-a-querys-gonna-be-bad-when-tsql2sday/
Scott – I’mma be honest, my first reaction was, “That’s ridiculous,” but then I realized I must have been finishing mine with semicolons for a decade now, and NOT doing it would indeed seem really weird. So I agree!
The missing semicolons are just the indicator of stranger things to come. I know I’m going to find all sorts of interesting ways the developer deviated from the norm and went against common standards.
You’re absolutely right—missing semicolons are just the tip of the iceberg. It’s always fascinating to see how far someone strays from the norm when they skip the basics.
[…] month’s T-SQL Tuesday question is posed by Brent Ozar. Thanks for […]
Howdy! Thanks again for hosting! I think I followed the directions correctly. If not, here is my link:
https://toddkleinhans.wordpress.com/2026/07/07/t-sql-tuesday-200-that-fresh-lint-code-smell/
Got it! I still don’t see people using linters, but I have high hopes that the AI revolution will turn that around.
Thank you for the invitation!
Here is my blog:
https://www.bronowska.com/articles/tsql2sday-200.html
Got it! Thanks for joining in this week!
[…] This month’s T-SQL Tuesday is from Brent Ozar (b|t) who is asking us to share the answer to “When I’m looking at a query, I bet it’s bad if I see ____.” […]
[…] while I was on vacation last week, I saw Brent Ozar’s invitation post for the 200th episode of T-SQL Tuesday. And fittingly this was a T-SQL topic. No need to bring out […]
[…] month is hosted by Brent Ozar (topic invite). He asks us to complete this […]
Hi Brent – my post’s at https://lobsterpot.com.au/blog/2026/07/08/signs-of-potentially-bad-code/
I was going to wait until the 14th, but figured that if I was done writing it and it was still the 7th somewhere in the world, I should hit Publish.
I’m hoping that your summary post will contain a script that demonstrates every bad trait that has been suggested by the responses.
Rob
Hahaha, Brent04 – man, I’m surprised by how often I find that repeated-update-pass problem! People just keep copy/pasting the same update statement and tweaking it to handle different situations in the business data, and next thing you know, you have a night-long ETL process. Thanks sir!
[…] anniversary edition is hosted by Brent Ozar. And his chose topic is: query red flags. Things that make you groan when you open a query and see them in the code. I’m sure there will […]
Here is my entry. Hopefully not to late to make the wrapup post 🙂
https://drsql.link/2026/07/07/t-sql-tuesday-200-concerning-query-traits/
Got it! Yeah, the wrap-up won’t hit until next Tuesday – a couple of old-school folks asked me to wait so they could publish their entry on the 14th, heh.
https://curiousaboutdata.com/2026/07/13/t-sql-tuesday-200-bad-query-signals/
Thank you for the extra time, much appreciated.
Mala
Added it to the roundup! Have a good week.
Thanks Brent! Sorry I went for the later date in your invite.
https://sqlblog.org/2026/07/14/tsql2sday-200-the-wrong-join
Thanks for joining in sir!
Thanks for hosting! My post is here: https://callihandata.com/2026/07/14/t-sql-tuesday-200-signs-of-a-bad-query/
Got it! Thanks!
I’m still working on setting up a blog, but here’s my LinkedIn article.
https://lnkd.in/p/gT3yauUN
Thanks for doing this!
My pleasure! Thanks for participating!
Thanks for hosting! Here’s my post: https://flxsql.com/2026/07/14/t-sql-tuesday-200-bet-its-bad/
Just in the nick of time! Thanks sir.
Sneaks into class, pulls down hoodie, sheeply chimes in “here”, drop this note:
https://www.mlakartechtalk.com/t-sql-tuesday-200-i-know-a-querys-gonna-be-bad-if-i-see/
JEFF. Buddy. Pal. You slink in here late, and your homework for “I know a query’s gonna be slow when I see … too many indexes”
JEFF
JEFF, I’m gonna need you stay after class. 😉
https://voiceofthedba.com/2026/07/07/t-sql-tuesday-200-when-i-look-at-a-query/
Got it! Thanks sir!
[…] this month’s T-SQL Tuesday, I invited y’all to tell me how you know a query’s gonna be bad when you open […]