show us your select statement, also. remember that joins between two datasources can be extremely inefficient. Pass as much criteria into a subquery for just the DB2 database that can be sent to the DB2 server. And return as few rows as possible in your DB2-only query -- GROUP as much as possible. otherwise, SQL Server must retreive EVERY SINGLE ROW in the table(s) in DB2 you are joining to, and do all the work on it's own.This is very similiar to using Linked tables in MS Access.for example, always try to rewrite stuff like this:select cust.ID, cust.name, sum(sales)from cust <-- local SQL tableinner join DB2...Sales <-- linked table (non-SQL Server)on cust.ID = sales.CustID group by cust.ID, cust.name
as:select cust.ID, cust.name, DB2.TotalSalesfrom cust inner join [b](select CustID, sum(sales) as TotalSales from DB2...Sales group by CustID) DB2on cust.ID = DB2.CustID
it can make a huge difference.- Jeff