does this raw sql only one trip to the database or many trips?
- by Álvaro García
I gues that I have this sql:
string strTSQL = "Begin TRAN delete from MyTable where ID = 1";
string strTSQL = ";delete from MyTable where ID = 2";
string strTSQL = ";delete from MyTable where ID = 3 COMMIT";
using(Entities dbContext = new Entities())
{
dbCntext.MyTable.SQLQuery(strTSQL);
}
This use a transaction in the dataBase, so all the commands are executed or no one. But how I execute it through EF, it does only one trip to the database or many?
Thanks.