• Your question is not clear. And changing midway from TableA to Horses doesn't help either.

    Please visit this link: http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/[/url] to find out what information we need to help you, and how to collect and post that information.


    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/