Saturday, February 25, 2012

odbc open query syntax to db2

Ok all you Gurus,
Here is a problem we are having, we have a sql server 2000 and we have
another server which is a DB2 server. The DB2 server is linked. We are
trying to run an open query and I do not think I have the right syntax
to accomplish this task. Please see query following
go
SELECT *
FROM OPENQUERY(Bacarditest,'SELECT top 10* FROM USA.accts')
go
I do not know if this is correct concerning the syntax for DB2 that
would be the sytax inside of the ()
this query runs fine with a select * instead of the top 10
please advise
thanx
Bill
*** Sent via Developersdex http://www.codecomments.com ***"Bill" <nospam@.devdex.com> wrote in message
news:%23UWynax4GHA.2144@.TK2MSFTNGP04.phx.gbl...
> Ok all you Gurus,
> Here is a problem we are having, we have a sql server 2000 and
> we have
> another server which is a DB2 server. The DB2 server is linked.
> We are
> trying to run an open query and I do not think I have the right
> syntax
> to accomplish this task. Please see query following
>
> go
> SELECT *
> FROM OPENQUERY(Bacarditest,'SELECT top 10* FROM USA.accts')
> go
> I do not know if this is correct concerning the syntax for db2
> that
> would be the sytax inside of the ()
> this query runs fine with a select * instead of the top 10
> please advise
> thanx
> Bill
Try this Bill (untested),
SELECT *
FROM OPENQUERY(Bacarditest,'SELECT * FROM USA.accts FETCH FIRST
10 ROWS ONLY')
- Arnie

No comments:

Post a Comment