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
Asked
Active
Viewed 1,510 times
2
-
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 Answers
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