SQLTeam.com | Weblogs | Forums

Concurrency issue, Stored Procedure, Table Valued Function


#1

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
)

as
BEGIN
SET NOCOUNT ON;

begin transaction
.......
Appreciate your help!


Adding previous or next row values based on condition
#2

I would recommend you do not use TVFs as @parms, not sure how widespread they are in your ecosystem. I would recommend changing that to @xml as parm. We just started moving away from them because they are problematic in so many ways.


#3

Ok thanks Yosias!