Assembly | SqlServer.Rules.dll |
Namespace | SqlServer.Rules.Performance |
Class | ConsiderRecompileQueryHintRule |
Id | SRP0022 |
Friendly Name | Procedure level recompile option |
Category | Performance |
Ignorable | true |
Applicable Types | Procedure |
Consider using RECOMPILE query hint instead of the WITH RECOMPILE option.
System.Xml.XmlElement
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