2

I have a set of tables I need to run some queries against. 2-3 tables used are the same so makes sense to create a tmp table (limited access to the server so no views, stored proc solutions please). Any idea how to achieve that using linq2db? TIA

  • You have typo in topic. The question is: How to create temporary table by linq2db? But do you have rights to do this if you have limited access? Do you can create your own view? – Adam Silenko Apr 07 '16 at 19:34

1 Answers1

4
using (var db = new DataConnection()
{
    var tempTable = db.CreateTable<MyTempTable("#tmp");

    (
        from t in ...
        select t...
    ).Insert(tempTable, t => new MyTempTable { Field1 = t.... });
}
IT.
  • 859
  • 4
  • 11