Sample Header Ad - 728x90

Difference between with recompile and Option(recompile)

0 votes
1 answer
4417 views
I've read online that with recompile will recompile the whole procedure whereas Option(recompile) will only the recompile a specific statement that it is used on. If a certain statement in the procedure is recompiled, won't it affect other parts of the procedure because now the optimizer has better stats to make better decisions later on (assuming the option(recompile) produces better stats) and thus causing a complete recompile of the procedure? How exactly does with recompile differ from option(recompile)?
Asked by stargazer77 (11 rep)
Jan 4, 2023, 06:15 PM
Last activity: Jan 4, 2023, 10:42 PM