• I'm not sure I understand the question. Can you please post a full repro script?

    (I.e., CREATE TABLE statements for all tables involved, INSERT statements with just enough rows to show the problem, the statement you executed, the results you got, and the results you wanted to get).

    An explanation of what you are trying to achieve and why you are doing this can also help.


    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/