Viewing 2 posts - 1 through 3 (of 3 total)
Thanks Alan.In doing some additional testing, and reading up on parameter sniffing (https://www.brentozar.com/archive/2013/06/the-elephant-and-the-mouse-or-parameter-sniffing-in-sql-server/), I'm finding that the following code addition makes a significant performance improvement (5 minutes to...
February 25, 2019 at 4:45 pm
#2022930
Here is the code for the UDF:CREATE FUNCTION [dbo].[fn_Get_Date_Params]( @strPeriod varchar(254), @dtmStart_Date datetime, @dtmEnd_Date datetime, @dtmGetDate datetime, @intWhichOne int)
RETURNS datetime
AS
February 25, 2019 at 2:47 pm
#2022923