• Good question. I had to do a bit of research - I knew it wasn't allowewd in inline functions, but was unsure about multi-statement and scalar functions.

    The link provided in the explanation is for SQL Server 2005; here are two links for the current version:

    http://msdn.microsoft.com/en-us/library/ms175976.aspx

    http://msdn.microsoft.com/en-us/library/ms186755.aspx


    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/