• Are you using this query inside a stored procedure? If so there might be an issue of Parameter Sniffing.. Check in relation with that..

    Good Luck 🙂 .. Visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.