Category Archives: Dynamic SQL

  1. Comments in your generated code : T-SQL Tuesday #155

    4

    October 11, 2022 by Kenneth Fisher

    The ever amazing Steve Jones (blog|twitter) is our host this month. And in case you didn’t know he also is …
    Continue reading

  2. Running dynamic SQL in a different database

    10

    May 19, 2022 by Kenneth Fisher

    This is one of those things that on hindsight was a stupid problem, but still cost me hours and a …
    Continue reading

  3. You can’t use GO in dynamic SQL.

    2

    February 10, 2022 by Kenneth Fisher

    This is one of those things that when I look back on it seems really obvious. Note: If at the …
    Continue reading

  4. The curious case of CHAR(0)

    12

    November 14, 2019 by Kenneth Fisher

    Over the years I’ve seen quite a few strange things with SQL Server. This one may not have been the …
    Continue reading

  5. Parameterized dynamic SQL is parameterized.

    3

    November 15, 2018 by Kenneth Fisher

    Ok, that title sounds silly, but it’s actually a real point. The first parameterized refers to using parameters within dynamic …
    Continue reading

  6. Escaping strings

    Leave a comment

    September 24, 2018 by Kenneth Fisher

    No, I’m not talking about that nightmare everyone has where a bunch of strings are chasing you across a loom. …
    Continue reading

  7. Using Table Valued Parameters with sp_executesql

    3

    September 13, 2018 by Kenneth Fisher

    Recently I did a presentation on dynamic SQL. In the presentation I pointed out the similarity of using sp_executesql to …
    Continue reading

  8. Nada to Speaker: Demystifying and Diminishing Dynamic SQL Difficulties

    3

    August 20, 2018 by Kenneth Fisher

    Last Thursday I spoke at NTSSUG (North Texas SQL Server User Group). This is my local group (only 1.5 hours …
    Continue reading

  9. Variables in Dynamic SQL

    4

    November 16, 2017 by Kenneth Fisher

    I had someone ask me about this the other day. Specifically getting variable data out of a dynamic SQL statement. …
    Continue reading

  10. Dynamically generate the command line DMA statement for each database

    1

    June 21, 2017 by Kenneth Fisher

    If you are upgrading your instance to 2016 (or 2017 soon) then you probably are going to want to run …
    Continue reading

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 3,975 other subscribers

Follow me on Twitter