I have a linked Oracle 11g server in Microsoft SQL Server 2012.
I am trying to retrieve a large linked dataset from Oracle and so to limit it I want to just get the first 100 records.
In SQL Server it's simply
select top 100 from ....
In Oracle the syntax is
...where rownum <= 100 order by rownum
As soon as my SQL Server 2012 query has more than two joins in it my
select top 100
causes the following error
OLE DB provider "OraOLEDB.Oracle" for linked server "BIS" returned message "ORA-01403: no data found
Msg 7346, Level 16, State 2, Line 1
Cannot get the data of the row from the OLE DB provider "OraOLEDB.Oracle" for linked server "BIS".
If I take top 100
out, it works but drags too much data over our network. Plus I also need to add a considerable number of joins to the select statement to the 3 I already have before I'm finished.
How can I join a large number of tables in a select statement but only return the first 100 records using T-SQL syntax on my SQL Server 2012 and retrieve these records from Oracle?