Why do I need Stored Procedures when I have LINQ to SQL

前端 未结 18 1262
栀梦
栀梦 2021-02-05 15:59

My understanding of Linq to Sql is it will take my Linq statement and convert it into an equivalent SQL statement.

So

var products = from p in db.Product         


        
18条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-05 16:30

    Reason : Large amounts of data to move from one table to another.

    Let's say that once in a while you have to archive items from one table to another or do similar things. With LINQ that would mean to retrieve let's say one million rows from table A into the DBMS client and then insert them into table B.

    With a stored procedure things work nice, in sets.

提交回复
热议问题