Blog

T-SQL Tuesday #159 – What’s Your Favorite New Feature?

Invitation and wrap up from Deepthi Goguri.

This month, I am inviting everyone to blog about two topics:

  1. Blog about your new favorite feature in SQL Server 2022 or in Azure. Why is it your favorite feature and what are your experiences and learnings from exploring this feature? If you have not explored these new features yet, No worries! Blog about the features you feel interested in exploring.
  2. New year, New Resolutions. What are your new year resolutions and how do you keep the discipline doing it day after day? Here are some examples: new hobby, plan to spend more time doing physical activity, wanted to read list of books (Please mention the names so it may also inspire others to read those books), journaling or any other resolutions you plan for this year.

Here are my answers to above questions:

  1. I am looking forward to learn about my favorite feature Query Store and its advancements in the SQL Server 2022. Query Store feature now supports the read only replicas from availability groups. The other advancement in Query Store is Query Store hints. I have written a blog post about it here. The other new feature is the parameter sensitive plan optimization where multiple plans are stores in plan cache for a single stored procedure reducing the parameter sniffing problems.
  2. This year, my resolution is to include exercise to my daily routine and reading David Goggin’s book all over again “Can’t Hurt me” before I begin to read his second book “Never finished”. It is getting harder to keep the exercise discipline. I had my gaps but I know I will get into the track again. I believe it is all about doing your best when you feel the worst. I am looking forward to listen to your resolutions and your discipline in following them day in and day out.

If you are looking for the latest features in SQL Server 2022, follow this series of videos by Bob Ward and Anna Hoffman explaining the new capabilities and features for SQL Server 2022. For new features in Azure, please check Azure SQL updates here and general overall Azure updates here.

T-SQL Tuesday #158, Implementing Worst Practices

Invitation from Raul Gonzalez.

One of the most repeated answers to almost any question asked within the SQL Server community is that “everything depends”… Can that also apply to known best practices?
 

Furthermore, is it possible that some of the commonly agreed “worst practices” have indeed some use case where they can be useful or suit an edge use case?
 

This month I am asking you to write about those not-so-common practices that you may have implemented at some point and the reasons behind it, I have a few in my pocket that will make more than one a bit uncomfortable 😀

T-SQL Tuesday #157 – End of Year Activity

This month’s invitation and recap from Garry Bargsley.

Welcome to the final T-SQL Tuesday for 2022. My ask is, what do you have planned for end-of-year activities for your SQL environment? Do you have annual processes or procedures you run? Do you clean up documentation? Do you just take time off and hope someone else does the work?

Some Examples:
  • Purge log data
  • Archive databases for long term
  • Look for orphaned data/log files on your SQL Servers
  • Do Security analysis for no longer needed accounts
  • Add new years dates to dimension tables

T-SQL Tuesday #156 – Production Code

Invitation from Tom Zika.

I’m a learner by example, so when I started programming (not so long ago), I tried to find existing solutions on various Q&A sites or blogs, as one might.

After a while, I noticed one sentence repeating often enough that it stuck with me:

“This is not a production-grade code”.

So here’s my invitation: “Which quality makes code production grade?”

You might think: “Production code is code that runs in production, duh.”

But let’s help out the newbies who look for a bit of concrete guidance.
Please be as specific as possible with your examples and include your reasoning.

I’m not limiting the scope to just the SQL; it can be anything.

T-SQL Tuesday #155 – The Dynamic Code Invitation

Invitation from Steve Jones.

I saw a post recently where someone noted they used Excel to help build dynamic SQL for their job. I thought that was a) creative, and b) similar to something I’ve done. In fact, that will be my post for this month.

However, while many of the experts decry dynamic SQL as a poor way of solving problems, it is not going away. In fact, it works really well for many situations and problems, albeit not necessarily a high volumes of data. There also are security concerns.

My invitation this month is to write about producing SQL dynamically in some way. Let us know about any of these things:

  • a problem you solved
  • a creative use of technology to build SQL
  • security concerns
  • a place where dynamic SQL failed you
  • a way to convert dynamic SQL to something cleaner
  • anything else that relates to code producing code

T-SQL Tuesday #154 – SQL Server 2022

Invitation from Glenn Berry.

Your mission, if you choose to accept it, is to write about what you have been doing (if anything) with SQL Server 2022. Maybe you have been doing a lot of testing with the public CTP builds and now RC0. Perhaps you have not had the time (or interest) in doing any SQL Server 2022 testing or research. Whatever you have been doing, now is your chance to talk about it, good or bad.

Maybe you can’t wait for SQL Server 2022 to be released, or perhaps you couldn’t care less about it. I would love to hear what your experience has been and what your opinions are about this release. If SQL Server 2022 is not on your future roadmap, please tell me why.

Just in case you haven’t heard much about SQL Server 2022, here are a few links from Microsoft.

T-SQL Tuesday #153 – The Conference That Changed Everything For Me

Invitation and roundup from Kevin Kline.

My invitation is about the social side of life as an data professional, specifically conferences and events. As one of the original nine founders of PASS and an early president of the association from 2004-2010, I always looked forward to the fall and the yearly PASS Summit. The leadership of PASS always worked hard to make the event feel like not only the best SQL Server and Azure SQL training event, but also like a big family reunion. (Check out the #sqlfamily hashtag on social media. It’s a thing!) Many bloggers have already written about #sqlfamily goodness from their attendance at the PASS Summit. Maybe we will see a couple of those blogs reposted?

With the last couple years pandemic lockdown behind us, we might not have many recent examples from the past two years. On the other hand, we have so much to look forward to with anticipation this fall! For many of us in this industry, conferences and events are the highpoint of our yearly business cycles. And with good reason, because we attended an event that had a lifelong positive impact on us. The invitation –

Tell us the story of how attending an IT conference or event resulted in an amazing career or life opportunity.

Of course, job and career opportunities readily jump to front of mind. But I ask you not to limit yourself to stories solely focused on career opportunities or job changes. I’ve seen so many other great outcomes happen for people who attended events like the PASS Summit, SQLBits, and others. I’ve even seen people meet, fall in love, and begin their journey as a couple because they both attended the same event. How wonderful is that?!?

Here are some other ideas. Did you connect with a new group of friends who are now a constant part of your life? Maybe you found a mentor who helped you in a multitude of ways? Perhaps you attended an event that started as the launch point of your own personal advancement as a speaker, blogger, writer, mentor, or community leader? Or maybe you learned an entirely new set of skills that amplified your success at your current job? It could be something even simpler, like finding out about a new musical act, writer, or artist who now is your favorite! Whatever your story might be, I would love to read your blog post about the conference that changed everything for you.

I hope I have inspired you to participate. Your action might then inspire others, starting a virtuous cycle of continued improvement for our community. Now, read the blog party rules below and get started!

T-SQL Tuesday #152 – It Depends

Invitation and round up from Deborah Melkin.

I came to a realization lately that I have a few opinions about databases. And I’m pretty sure that you do too. After all, I’ve read your blogs, chatted with you, and seen your Twitter rants.

But we’re database professionals. It’s supposed to depend, right?

Except we all have experiences that shape how we approach our work. One minute your coworker asks you a question about doing X. You reply with “It Depends…” leading into a 5-10 minute rant. This may include some or all of the following:

  • Stories starting with “that one time at that client”
  • References to blog posts you read\wrote\should write
  • Commentary on code – the good, the bad, & the ugly
  • Personal theories and philosophies on the topic

All of this is followed by “Thank you for coming to my TED talk” and a “I’m sorry, what was your question again?

So yeah… this may have been inspired by an actual conversation… or two… or ten. I apologize to my coworkers… again…

So for this month’s T-SQL Tuesday, I want you to give us that rant. Tell us about the experiences, the code, the posts that inspired you, and all the gory details in between. And what is it that makes you so passionate about this topic that “It Depends” gets tossed out the window? Pull out your soapbox and tell us all about it

T-SQL Tuesday #151 – Coding Standards

Invitation and roundup from Mala Mahadevan.

My invite is about coding standards, or what I now call Linting Rules, for T-SQL. What are the T-SQL coding rules that are appropriate for where you work and what you do? If there are exceptions to those rules, state them too! If this is enough, read the blog party rules below and get started!!

  • Your post must be published on Tuesday June 14, 2022.
  • Your post must contain the T-SQL Tuesday logo (see above) and the image must link back to this blog post.
  • Trackbacks should work, but if not please put a link to your post in the comments section so everyone can see your contribution! (My comments are moderated so please don’t worry if yours doesn’t appear right away, I will make sure it does!)
  • If you are on twitter include the hash tag #tsql2sday – it helps with RT-s and visibility!!

More on why I picked this topic as below –

When I started out as a DBA two decades ago, I had a list of rules that I would carry with me into every job I went..these are things I look for in T-SQL code and try to enforce as standard. Some examples were casing rules, minimized usage of SELECT STAR, equating the right data types in columns, avoiding NOLOCK hint and so on. Standards ensure quality and consistency in code.

Standards differ for each firm, depending on what is appropriate for an environment..it is even possible to have varying standards in the same company, depending on the environment and what is appropriate for a database. This is an excellent article on what are the different components that comprise coding standards, and why we need them. I am also a big proponent of automated code checking for standards – there are lots of tools available for doing this – SQL Prompt, which is a personal favorite of mine, and many others as listed here.

Several tools currently do linting on many relational platforms, not just SQL Server. Almost all of them though, have rules that the author(s) think are best for the worlds they work in, and do not include other conditions which they have not encountered yet. A common example I like to use is unnamed primary keys on temporary tables. There is nothing inherently wrong with having an inline primary key constraint/index on a temporary table – but if you use Query Store, plan forcing on a plan that uses this temp table will not work simply because the constraint gets named differently each time. When I started to look for a linting tool for where I work – I ran into so many rules that were non-existent or not applicable to my environment with outside tools that I decided to write my own using ScriptDOM – a Microsoft-provided library that was created specifically for this purpose.

It would help greatly if we had a collection of rules that people use to pick from and enforce as appropriate for their environments. It will also help me to code some of these into ScriptDOM and put it out on GitHub, if the rule is one that ScriptDOM can find easily. So, re-stating the call for this month – What are the T-SQL coding rules that are appropriate for where you work and what you do? If there are exceptions to those rules, state them too!

T-SQL Tuesday #150 – Your First Technical Job

Invitation from Kenneth Fisher.

This month for TSQL Tuesday I’d like to hear about your first technical job(s). I know most DBAs don’t start out working with databases so tell us how you did start. I’m generally thinking of your first tech job, but if you had a job early in your career that wasn’t technical at all but still makes for a good story feel free to share! I can’t wait to hear about it.