Home Forums SQL Server 2016 SQL Server 2016 - Development and T-SQL Odd behavior -- execution plan different when I execute in the target database vs not in the target database RE: Odd behavior -- execution plan different when I execute in the target database vs not in the target database

  • Ah ok, I see but I'm fully qualifying the DB in the query.  Here's the query in question that I used above.  Whatever I have selected in the context, it should query DataMart, right?  What does the context thing even effect when fully qualifying in the query?

    SELECT count(*) 
    FROM [Datamart].[VersaReg].[DMV_ESE_FACILITIES]