0

I have a result set I need to pull in from a linked DB2 server table into SQL Server. The table is huge, and I don't want or need to pull the whole thing, I only need the records for a handful of users. The problem is the User IDs are stored in a SQL Server table, not on the DB2 table. While I have select privileges on the DB2 server, I cannot create a table there, so as far as I'm aware I cannot upload the table with User IDs onto the DB2 server. Is there a way to limit the result set pulled from the DB2 server on the User IDs stored in the SQL Server table?

3
  • How many user IDs are involved in a single query?
    – Greg Low
    Commented Jul 3, 2020 at 23:29
  • I'll need to run it for 5 different time periods with around 100 IDs each. Commented Jul 4, 2020 at 3:38
  • You might want to try generating your queries dynamically on the SQL Server side, sending IDs as literals to the remote server, to ensure application of the predicate on the remote side.
    – mustaccio
    Commented Jul 5, 2020 at 13:07

0

Browse other questions tagged or ask your own question.