Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Rotha_HUOCH
		
			Rotha_HUOCH
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello,
I am calling the community because I need your help to execute a stored procedure.
I am able to run a simple stored procedure that contains an insert, using the following components:
It works very well.
Now I want to run the stored procedure below:
DECLARE @v_spid INT
DECLARE c_Users CURSOR
FAST_FORWARD FOR
SELECT SPID
FROM master..sysprocesses (NOLOCK)
WHERE spid>50
AND loginame <> 'DIR%'
AND program_name LIKE N'%Microsoft Dynamics NAV Classic client %'
AND status='sleeping'
AND DATEDIFF(mi,last_batch,GETDATE())>=25
AND spid <> @@spid
OPEN c_Users
FETCH NEXT FROM c_Users INTO @v_spid
WHILE (@@FETCH_STATUS=0)
BEGIN
PRINT 'Killing '+ CONVERT(VARCHAR,@v_spid)+'...'
EXEC('KILL '+ @v_spid)
FETCH NEXT FROM c_Users INTO @v_spid
END
CLOSE c_Users
DEALLOCATE c_Users
The purpose of this procedure is to disconnect users who are inactive for more than 30 minutes (in the erp).
It works great when I run it manually via ssms.
On the other hand, when I run it via Talend, I have no error message but it is obviously not executed since inactive users remain connected
 Rotha_HUOCH
		
			Rotha_HUOCH
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		wow, still no answer after months of waiting 😞
Could a nice super user help me or give me a link to a solution?
 gjeremy16170881
		
			gjeremy16170881Hi, have you try a tDBRow with :
"EXEC kill_sessions;" ?
Send me Love and kudos
 Rotha_HUOCH
		
			Rotha_HUOCH
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Let me check
 Rotha_HUOCH
		
			Rotha_HUOCH
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I don't think it's working because right after I execute le talend job, the users are still connected :
 pawe84
		
			pawe84
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Have the same issue. No one has a solution for it?
