March 7, 2013 at 5:10 pm
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]..[SCHEMA].
SELECT TOP 10 *
FROM OPENQUERY([LINKED_SERVER], 'SELECT * FROM .[SCHEMA].')
Both return all Records.
If I try this:
SELECT *
FROM OPENQUERY([LINKED_SERVER], 'SELECT * FROM .[SCHEMA]. 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?
October 28, 2015 at 4:34 am
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')
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy