Hi,
I am using SQL Server 2008 and I have the following SQL script:
Select o.CustomerId as CustomerNoId, OrderValue, OrderDate
From dbo.Orders as o
Inner Join (
Select Top (10) CustomerId
From dbo.Customers
where Age < 60
)
As c
On c.CustomerId = o.CustomerId
This works as desired when used with dbo.Customers and dbo.Orders on the local SQL Server instance. It returns all rows from the orders table for the first 10 customerIds returned from the the Customers table - 1688 rows.
However I have a linked server holding the Customers and Orders tables containing many more rows. When I modify the script to use dbo.Orders and dbo.Customers tables from the Linked Server I get a strange result - It appears the correct data is returned, but only the top 10 rows of it.
I am no SQL expert so I can't figure out why it should behave any differently.
Any suggestions appreciated.