Avoiding the 2100 parameter limit in LINQ to SQL

前端 未结 3 1548
别那么骄傲
别那么骄傲 2021-01-12 14:17

In a project I am currently working on, I need to access 2 databases in LINQ in the following manner:

  1. I get a list of all trip numbers between a specified d

3条回答
  •  情书的邮戳
    2021-01-12 14:38

    as LINQ-to-SQL can call stored procs, you could

    • have a stored proc that takes an array as a input then puts the values in a temp table to join on
    • likewise by taking a string that the stored proc splits

    Or upload all the values to a temp table yourself and join on that table.

    However maybe you should rethink the problem:

    • Sql server can be configured to allow query against tables in other databases (including oracle), if you are allowed this may be an option for you.
    • Could you use some replication system to keep a table of trip numbers updated in DB2?

提交回复
热议问题