Showing results for 
Search instead for 
Did you mean: 

Stored Proc, DYNAMIC SQL returns no rows

New Contributor

Stored Proc, DYNAMIC SQL returns no rows

This is a bit confusing to explain, but here I go. I have an MS SQL Stored PROC that I can run with a dataSource test step. It will return rows if the PROC does NOT have any dynamic SQL embedded in it. So if there is a simple table select, it works fine. If you add dynamic SQL like:


EXEC sp_executesql @SQL



It returns no rows...

This Statement above uses dynamic SQL and temporary tables. It no longer works with default JDBC drivers.


Why would dynamic SQL affect the JDBC drivers? They should not care what the PROC does, only its response. I have checked the response with other software drivers and it is the same for static and dynamic SQL.

Anyone else with this problem?

Should I install the net.sourceforge.jtds.jdbc.Driver ?
How do i register this drive and get it to show up on the list of available drivers in the SOAPUI application?

I am able to call another driver with groovy, but it is not on the SOAPUI dropdown lists...


import groovy.sql.Sql "net.sourceforge.jtds.jdbc.Driver")

String csuf = "";
def list= []

String pP_Model = testRunner.testCase.testSuite.project.getPropertyValue( "TestModel" )
String pP_SqlServer = testRunner.testCase.testSuite.project.getPropertyValue( "SqlServer" )
String pP_SqlUser = testRunner.testCase.testSuite.project.getPropertyValue( "SqlUser" )
String pP_SqlPwd = testRunner.testCase.testSuite.project.getPropertyValue( "SqlPwd" )


def sql = Sql.newInstance("jdbc:jtds:sqlserver:" + pP_SqlServer, pP_SqlUser, pP_SqlPwd, "net.sourceforge.jtds.jdbc.Driver")

def res = sql.eachRow("exec get_available_Figure_for_Model '" + pP_Model + "' ") { it.toRowResult().values())
csuf = it.toRowResult().values()


This driver does not seem to have issues with dynamic SQL or is there a bug with the datasource steps?

thanks for your help...

Stephen Love
Software Developer
New Contributor

Re: Stored Proc, DYNAMIC SQL returns no rows

Ok. I did some more testing and I am convinced there is a bug with SoapUI.

Attached are some screeenshots with some highlighted sections of interest. Basically, I have added the sourceforge JDBC driver to test an alternate from the one included with the install (MS JDBC). Both drivers result in the same dysfunction.

File > Preferences > JDBC driver Properties

This will add the option of using the sourceforge JDBC driver to SOAPUI datasource steps.

When I use this driver, the results are the same as the MS driver. No rows are returned to the datasource step if you call a stored PROC with dynamic SQL.

Now if you try a JDBC request, sourceforge driver and call the stored PROC, it does respond... BUT the output xml returns an inaccurate result:

it should return:

You can see the response time (screenshot) takes about 7-8 seconds because the PROC is complicated. That is the same execution time it takes in MS Management studio. It also returns 55 bytes, which is about the size of the result is should return.

For the last test, I create a Groovy step and programmatically executed the PROC with the sourceforge driver. The result returned in about 8 seconds with the CORRECT data!

So to sum this up, Using a groovy step, I can get the data. Using Datasource and JDBC request steps do NOT return data. That has to show there is a bug in these features.

I could be convinced otherwise, if someone can demonstrate working a Datasource step with MS SQL dynamic PROC's. We need these features to work in order to effectively use LOADUI PRO and SOAPUI PRO.

Please help if someone knows a workaround or a trick to get this to work!

Thank you


Re: Stored Proc, DYNAMIC SQL returns no rows


It looks like you opened a support ticket for this issue and this is being handled through the support case.

SmartBear Support

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Occasional Contributor

Re: Stored Proc, DYNAMIC SQL returns no rows

Any news on this issue?

Community Manager

Re: Stored Proc, DYNAMIC SQL returns no rows

Hi @peti2005,


I see that you've created a separate topic about a similar issue:


I suppose the question is resolved, right?

Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Occasional Contributor

Re: Stored Proc, DYNAMIC SQL returns no rows

Dear Tanya


Yes, the problem is solved. Apologies for confusion.

New Here?
Join us and watch the welcome video:
TechCorner Leaderboard
Compete with community members in the TechCorner Challenge and get into the Leaderboard!

Rank Participant Points Earned
1 msiadak 12
2 nmrao 8
3 HimanshuTayal 3
Top Kudoed Authors