Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

LINKED SERVER to NETEZZA QUESTION Expand / Collapse
Author
Message
Posted Thursday, March 7, 2013 5:10 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, April 22, 2013 12:46 PM
Points: 14, 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?
Post #1428329
Posted Wednesday, October 28, 2015 4:34 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, January 25, 2016 7:59 AM
Points: 1, 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')
Post #1731447
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse