We have sql SP's being called from Java code.
The execution on sql server side comes in as a call to "sp_prepexec".
For some reason, whenever @p1 is passed as NULL, the SP goes for a toss..runs for more than 30 secs (our timeout period)..whenver proper value is passed, the execution time is in milli seocnds...Any any one throw ligh on this "sp_prepexec" and the @p1 parameter...like..when/why would it be passed as a NULL...any help would be appreciated...
DECLARE @p1 INT
SET @p1 = NULL
DECLARE @p9 NVARCHAR(max)
SET @p9 = N'0'
EXEC sp_prepexec @p1 OUTPUT
,N'@P0 nvarchar(4000),@P1 nvarchar(4000),@P2 nvarchar(4000),@P3 nvarchar(4000),@P4 nvarchar(4000),@P5 nvarchar(4000) OUTPUT'
,N'EXEC MySPname @P0, @P1, @P2, @P3, @P4, @P5 OUT '