troubleshooting Question

Query syntax for Linked Table from SQL Server to AS400

Avatar of Michael Purdham
Michael PurdhamFlag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft SQL ServerMicrosoft SQL Server 2008
8 Comments3 Solutions2486 ViewsLast Modified:
I have reposted this question as I seem to have categorised it incorrectly.
Old one is deleted.

I have SQL Server 2008 R2 where I have created a linked server to my AS400 using the following
Linked Server=TRDATA
Provider=IBM DB2 UDB for iSeries IBMDA400 OLE Provider
Data source= Hostname of server
Provider string = User Id=uuuu;Password=pppp;Default Collection=LibraryName
Location = Blank
Catalog = Blank

If I right click on the Linked Server and select Test Connection this is successful.

I want now to just select data from a table XXXX on the AS400 in library YYYY

Given the above what is the query to pull records where field CCCC = 'FRED'

I have searched for a definitive statement that works and have tried many permutations but all fail.

Can anyone give the precise statement?
Michael Purdham

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros