Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 JDBC returning erradic dataset sizes

Author  Topic 

Crowknee
Starting Member

5 Posts

Posted - 2008-04-09 : 21:25:09
Hi All,
I am having an issue with a JDBC based reporting tool when connected to my SQL2005 db. Basically I am getting erradic results. Let me explain the two cases.
1) The full result set gets returned. This is good. In my trace file, I can see the cursor getting created and chunks of 50 records returning to the program. The last chunk has 10 records in it (a total of 960 records).
2) Partial results returned. 10 records, which is strangely enough the last chunk size of the full result set. No errors are flagged.
The vendor of the product ensures me that they cannot replicate the problem (even given my db), and I am having trouble identifying places/settings in SQL2005 that might help.
If it makes a difference, the dataset is a query with many LEFT OUTER JOINS, but the problem seems to stem from the inclusion of a subquery which uses a function in its from clause. EG.
SELECT blah1, blah2
FROM table1 LEFT OUTER JOIN table2 ON ....
...
WHERE EXISTS (SELECT id FROM func1(2,2) WHERE id = blah1)

If I remove the EXISTS clause, things seem to work well.

My @@version = Microsoft SQL Server 2005 - 9.00.2050.00 (Intel X86) Feb 13 2007 23:02:48 Copyright (c) 1988-2005 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

Any help with this would be GREATLY appreciated.
Thanks,
Steele.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-09 : 21:42:34
It's hard to help given the information that you have provided. We'd have to see all of the relevant T-SQL code including the functions.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Crowknee
Starting Member

5 Posts

Posted - 2008-04-10 : 19:38:53
Found the problem.
It was a driver issue - I am not sure what version the product was using but the latest one seems to have fixed the issue.
Thanks for the help.
Steele.
Go to Top of Page
   

- Advertisement -