SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


LINKED SERVER to NETEZZA QUESTION


LINKED SERVER to NETEZZA QUESTION

Author
Message
David F
David F
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 61
Hello, I have what I hope is a simple question. I have setup a linked server using a System ODBC DSN that connects to a Netezza device. I'm currently testing, and while the performance is solid, I'm having trouble understanding what is happening when I try to "SELECT TOP [X] FROM ..."

My understanding is that this is supposed to be interpolated to "SELECT * FROM TABLE LIMIT [X]" but the query continues to give me all the records.

I've tried both of these:


SELECT TOP 10 *
From [LINKED_SERVER].[TABLE].[SCHEMA].[TABLE]



SELECT TOP 10 *
FROM OPENQUERY([LINKED_SERVER], 'SELECT * FROM [TABLE].[SCHEMA].[TABLE]')

Both return all Records.

If I try this:

SELECT *
FROM OPENQUERY([LINKED_SERVER], 'SELECT * FROM [TABLE].[SCHEMA].[TABLE] LIMIT 10')

I get an error that says "Incorrect syntax near "SELECT", found "10" "
If I Alias the table then I get the same error except it says found 'Limit'

Any ideas?
anwar.mir
anwar.mir
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 26
Remove the square brackets and ensure all your tables in the Openquery string

SELECT *
FROM OPENQUERY([LINKED_SERVER], 'SELECT * FROM DATABASE.SCHEMA.TABLE LIMIT 10')
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search