Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 893 Bytes

SRP0022.md

File metadata and controls

46 lines (34 loc) · 893 Bytes

SQL Server Rule: SRP0022

Assembly SqlServer.Rules.dll
Namespace SqlServer.Rules.Performance
Class ConsiderRecompileQueryHintRule

Rule Information

Id SRP0022
Friendly Name Procedure level recompile option
Category Performance
Ignorable true
Applicable Types Procedure

Description

Consider using RECOMPILE query hint instead of the WITH RECOMPILE option.

Summary

System.Xml.XmlElement

Examples

good:

CREATE PROCEDURE dbo.my_proc
BEGIN
    SELECT col_A, col_b 
    FROM some_complicated_set 
    WHERE some_complicated_filter = 1 
    OPTION(RECOMPILE)

bad:

CREATE PROCEDURE dbo.my_proc
WITH RECOMPILE