Skip to content Skip to sidebar Skip to footer

Ms Sql - Different Execution Plan For Different Schemas?

MS SQL SERVER 2008 We have one stored procedure with the same parameters. We have two accounts with different schemas. And we have different execution plans for these two accoun

Solution 1:

I have finally found out where the issue is:

I have run the some code from different user accounts and these user accounts had different SET LANGUAGE option.

good article about it: http://allcomputers.us/windows_server/microsoft-sql-server-2008-r2---query-plan-caching-(part-1)---query-plan-reuse---query-plan-aging.aspx

Solution 2:

Comments removes formatting, so I post code to check SET options here:

SELECT  
    SESSIONPROPERTY('ANSI_PADDING') AS [ANSI_PADDING]
    ,SESSIONPROPERTY('FORCEPLAN') AS [FORCEPLAN]
    ,SESSIONPROPERTY('CONCAT_NULL_YIELDS_NULL') AS [CONCAT_NULL_YIELDS_NULL]
    ,SESSIONPROPERTY('ANSI_WARNINGS') AS [ANSI_WARNINGS]
    ,SESSIONPROPERTY('ANSI_NULLS') AS [ANSI_NULLS]
    ,SESSIONPROPERTY('QUOTED_IDENTIFIER') AS [QUOTED_IDENTIFIER]
    ,SESSIONPROPERTY('ANSI_NULL_DFLT_ON') AS [ANSI_NULL_DFLT_ON]
    ,SESSIONPROPERTY('ANSI_NULL_DFLT_OFF') AS [ANSI_NULL_DFLT_OFF]
    ,SESSIONPROPERTY('DATEFORMAT') AS [DATEFORMAT]
    ,SESSIONPROPERTY('LANGUAGE') AS [LANGUAGE]

Post a Comment for "Ms Sql - Different Execution Plan For Different Schemas?"