Pandarian Ld
Pandarian Ld

Reputation: 767

Call stored procedure with named parameter in JMeter

I need to perform Load Testing SQL Server using JMeter. I create a thread group, JDBC Connection Configuration, and JDBC Request.

First, I try a simple stored procedure (SP) call which basically query and return data from database

exec STORE_PROCEDURE_NAME 'val1'

But I need to call SP which insert value in the database. I tried the following statement

exec STORE_PROCEDURE_NAME 'val1','val2','val3',val4,val5,@param6='val6'
exec DB_NAME.[dbo].[STORE_PROCEDURE_NAME ] 'val1','val2','val3',val4,val5,@param6='val6'
{call STORE_PROCEDURE_NAME (?,?,?,?,?,@param6=?)}
{call STORE_PROCEDURE_NAME (?,?,?,?,?,@param6=>?)}

where param6 is a parameter's name. After run either of them, JMeter stuck at Thread Start phrase.

The reason why I want to use named parameter because the SP contains around 20+ parameters and only 6 of them are required.

Any suggestion to make this works?

Upvotes: 0

Views: 83

Answers (1)

Ivan G
Ivan G

Reputation: 2907

  1. If JMeter is "stuck" check jmeter.log for any suspicious entries
  2. If there are no suspicious entries - increase JMeter logging verbosity to DEBUG level
  3. If JMeter is "stuck" and doesn't produce any logs - take a thread dump and look what's causing the "stuck"

In case of syntax error you should get the relevant SQL message from the database.

Demo of calling a stored procedure with parameters:

enter image description here

Upvotes: 0

Related Questions