This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes MS SQL JOIN query not returning all results Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "MS SQL JOIN query not returning all results" Watch "MS SQL JOIN query not returning all results" New topic
Author

MS SQL JOIN query not returning all results

David J Smith
Greenhorn

Joined: Jun 09, 2009
Posts: 24
Hi,

I am using the Microsoft SQL Server JDBC Driver 2.0.
I have the following query

When I run this in SQL Server Management Studio I get 176 rows returned, however when I run it using the JDBC Driver with the following command I only get 24 rows.

I am completely stuck, any help would be greatly appreciated.

David.
David J Smith
Greenhorn

Joined: Jun 09, 2009
Posts: 24
By the way, Table1 is a view, not sure if this makes any difference?
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3749
    
  10

Try putting the username in front of the table name, sometimes SQL server filters by user.


[OCA 8 Book] [Blog]
David J Smith
Greenhorn

Joined: Jun 09, 2009
Posts: 24
I'm logging into the server using the sa user so it should show everything no?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MS SQL JOIN query not returning all results
 
It's not a secret anymore!