T-SQL Tuesday #155 –The Dynamic Code Invitation

·

tsqltuesdayApologies for the late invitation. A minor snafu has me hosting again.

This is the monthly blog party where someone hosts and you all write a response. I’d like to think this is one where lots of you have a story or a situation that worked out. Write a post on 11 Oct and post a comment here.

The Invitation

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

The Rules

Only a few rules.

  • publish on 11 Oct 2022 sometime.
  • use the logo above and link back to this post
  • leave a comment or trackback/pingback here
  • Use the #tsql2sday hashtag to tag your post on Twitter, LinkedIn, etc.
  • Encourage others to blog

That’s it. Have fun and I look forward to reading your responses.

If you want to host, ping me on twitter (@way0utwest) or LinkedIn or email or anything really.

Comments

29 responses to “T-SQL Tuesday #155 –The Dynamic Code Invitation”

    1. way0utwest Avatar

      First, as always. Thanks Rob

      Like

    2. Rob Farley Avatar

      Well, my time zone means I’m awake when it becomes midnight GMT.

      Liked by 1 person

  1. T-SQL Tuesday #155 – The Dynamic Code Invitation – Andy Brownsword Avatar

    […] This months’ invitation from Steve Jones asks us to write about producing SQL dynamically in some form or another. We can create and execute SQL dynamically within our procedures but what about dynamically creating it from other sources before passing it into SQL Server? […]

    Like

    1. way0utwest Avatar

      nice, thanks for participating.

      Like

  2. Richard Swinbank Avatar

    Hey Steve, thanks for hosting this month – my contribution’s at https://richardswinbank.net/blog/metadata-driven-sql-code-generation. Richard

    Like

    1. way0utwest Avatar

      My pleasure and thanks for the post

      Like

  3. […] on his blog, Steve Jones invited the SQL community to write blog posts sharing their way of using SQL […]

    Like

  4. T-SQL Tuesday #155–Using Dynamic SQL for SQLCMD | Voice of the DBA Avatar

    […] that time of month, and I’m the host this month. I wrote the invitation last week and now its’ time to answer. I’m actually using an example from the past that I was reminded […]

    Like

  5. Ajay Dwivedi Avatar

    Hi Steve! This is how I am using dynamic sql to collect remote SQL Server Health Metrics.
    https://ajaydwivedi.com/performance-tuning/get-core-sqlserver-health-metrics-using-dynamic-sql/?swcfpc=1

    Like

  6. […] This month’s host is Steve Jones (B|T) and the topic is “The Dynamic Code Invitation“. […]

    Like

  7. T-SQL Tuesday 155, Dynamic SQL – Reitse's blog Avatar

    […] This month, Steve Jones (T) invites us to write about the way dynamic SQL helped us solve a problem. […]

    Like

  8. josh Avatar

    Thanks for hosting: I clearly had something to get out of my system…

    https://accitentionaldba.com/posts/2022/10/tsqltuesday155/

    Like

  9. […] Welcome to T-SQL Tuesday, the monthly blogging party where we talk about a topic given to us by the host. This month, we have Steve Jones (blog | twitter) asking us about Dynamic SQL. […]

    Like

  10. Gerard Jaryczewski Avatar
    Gerard Jaryczewski

    What a wonderful topic for telling stories… https://sqlrebel.blogspot.com/2022/10/show-me-everything.html

    Like

  11. […] October’s T-SQL Tuesday, Steve Jones asks us to talk about ways we’ve used dynamic SQL to solve problems. Dynamic SQL gets a bad rap simply because, like a lot of tools, it can be […]

    Like

  12. Nigel Foulkes-Nock Avatar

    Thanks for hosting – the time difference in Wales is getting worse! https://www.nigeldba.com/t-sql-tuesday-155-the-dynamic-code-invitation

    Like

  13. […] This month’s T-SQL Tuesday is all about the use of dynamic SQL. I use Dynamic SQL a lot in my role as a Data Engineer / DBA. […]

    Like

  14. […] #tsql2sday, sometimes the best dynamic SQL code you can write is the code that was dynamically generated for […]

    Like

  15. […] For #tsql2sday, sometimes the best dynamic SQL code you can write is the code that was dynamically generated for you from your tables or views. […]

    Like