SQL 2019 Bug : "SELECT @local_variable"

  • OK, got an update from Microsoft after raising a support ticket.

    This is what they say :

    I have a response from my colleague and this seems to be a defect.

    We have a workaround for this, until we are working, this is happening due to the SCALAR_UDF_INLINING.

    We have two options.

    SELECT dbo.fnTest() OPTION (USE HINT('DISABLE_TSQL_SCALAR_UDF_INLINING'))

    ALTER DATABASE SCOPED CONFIGURATION SET TSQL_SCALAR_UDF_INLINING = OFF

    The first option is the recommended if you don’t have many queries that need to be modified, as the second will be affecting your database, and if you had any performance improvement due to this, you will not take advantage from this performance improvement.

    Please let me know if this workaround helped you on your case.

    3 DataBase Admins walked into a NoSQL bar...
    A little while later, they walked out because they couldn't find a table.

  • Since you're not telling a declarative language exactly what you want it to do, you're counting on a behavior that you simply can't count on. I get it that it was doing one thing in 2016 and now is doing something different. I would not say that's a bug. It's just a difference in how the engine interprets a less than complete declarative statement.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • MVDBA (Mike Vessey) wrote:

    looks like it's tried to apply "parallelism" (not quite the correct word, but it will do) to the function - this is possibly a result of the new scalar value function inlining that is new in sql 2019

    YESSSS - I was 3 minutes faster than Microsoft in guessing this one

    MVDBA

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply