• Find your set options using your query

    SELECT plan_handle, usecounts, pvt.set_options,text

    FROM (

    SELECT plan_handle, usecounts, epa.attribute, epa.value ,text

    FROM sys.dm_exec_cached_plans

    OUTER APPLY sys.dm_exec_plan_attributes(plan_handle) AS epa

    CROSS APPLY sys.dm_exec_sql_text(plan_handle) a

    WHERE cacheobjtype = 'Compiled Plan' and a.text like '%MYQUERYTEXT%') AS ecpa

    PIVOT (MAX(ecpa.value) FOR ecpa.attribute IN ("set_options", "objectid")) AS pvt

    THEN plug the setoptions for your 2 queries into the below and see what set options differ.

    declare @set_options int = 4347

    if ((1 & @set_options) = 1) print 'ANSI_PADDING'

    if ((4 & @set_options) = 4) print 'FORCEPLAN'

    if ((8 & @set_options) = 8) print 'CONCAT_NULL_YIELDS_NULL'

    if ((16 & @set_options) = 16) print 'ANSI_WARNINGS'

    if ((32 & @set_options) = 32) print 'ANSI_NULLS'

    if ((64 & @set_options) = 64) print 'QUOTED_IDENTIFIER'

    if ((128 & @set_options) = 128) print 'ANSI_NULL_DFLT_ON'

    if ((256 & @set_options) = 256) print 'ANSI_NULL_DFLT_OFF'

    if ((512 & @set_options) = 512) print 'NoBrowseTable'

    if ((4096 & @set_options) = 4096) print 'ARITH_ABORT'

    if ((8192 & @set_options) = 8192) print 'NUMERIC_ROUNDABORT'

    if ((16384 & @set_options) = 16384) print 'DATEFIRST'

    if ((32768 & @set_options) = 32768) print 'DATEFORMAT'

    if ((65536 & @set_options) = 65536) print 'LanguageID'

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]