• I do not have a SQL Server 2014 instance at hand to play around with so I need to go by what I find documented at https://msdn.microsoft.com/en-us/library/dn452279%28v=sql.120%29.aspx.

    I do not see anything there that would rule out the construction you posted, but I assume that you have a valid reason for posting so I probably overlooked something in the small print.

    My first thought was to replace the UPDATE ... FROM (which is, in my opinion, a dangerous and impractical construction anyway) with an ANSI standard UPDATE syntax. But that would use subqueries, and those are listed as not supported in native compilation on SQL Server 2014, so that option is out.

    The only vialbe workaround that I still see is to code a loop that iterates over the rows in the @MinCompetitorsPrices table and then does an update of matching row(s) for each of the iterations of that loop. A coding style that is bound to be slow in traditional T-SQL, but native compilation can compensate for that. If you do build a procedure like that, I do recommend that you run a performance comparison between that version and a traditional (not compiled) version that used the UPDATE FROM you posted.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/