I found that forcing SQL Server to recompile the execution plan at runtime resolved the issue for the web application.
Here's a snippet of a CREATE PROCEDURE script that uses the WITH RECOMPILE option
CREATE PROCEDURE <Procedure_Name, sysname, ProcedureName>
-- Add the parameters for the stored procedure here
<@Param1, sysname, @p1> <Datatype_For_Param1, , int> = <Default_Value_For_Param1, , 0>,
<@Param2, sysname, @p2> <Datatype_For_Param2, , int> = <Default_Value_For_Param2, , 0>
WITH RECOMPILE
AS
BEGIN
1 comments:
Niice blog
Post a Comment