I have a stored procedure that gets a call from web apps and apis and returns data respectively. The issue I am having is when the proc gets called at the same time from different sources, the table valued function stores all the inputs parameters and doesn't reset as it goes from one to another call. How do I reset table valued function used as input param? I have tried sp_getapplock and it doesn't work for what I am looking for.
The initial part of the procedure looks like this:
ALTER PROCEDURE [dbo].[csp_procedure]
@parameters as TableValuedFunction READONLY
SET NOCOUNT ON;
Appreciate your help!