LINQ to SQL is the Devil?

Last Thursday I attend the SQL Server Pass Camp in Denver.  As one of the only developers there I got a lot of negative vibes related to LINQ to SQL and ADO .Net Entity Framework.  DBAs seem to think any tool that generates SQL statements is evil.  I have to admit I agree with them.  Even if the generated SQL is flawless, it can take away the DBAs ability to tune performance.

However, I think there is a happy medium that will help DBAs sleep at night and still give the developers the flexibility they need.  It's the same answer we've been using for years, Stored Procedures.  If you think about it, developers have had the option of running SQL queries directly against the DB for years using inline SQL statements.  So, nothing has really changed.  LINQ to SQL and the Entity Framework both have full support for stored procedures.  Use Stored Procedures for all updates, inserts and deletes.  You can also use stored procedures to retrieve data. However this takes away some of the the flexibility LINQ to SQL and the Entity Framework provide to the developer.  So, for reads I recommend using views.  They allow DBAs to restrict the columns visible and also provide an extra layer of security.

All the feed back I received from DBAs was positive once I explained that stored procedures and views are still the best practices for these new technologies.  They were also put to ease when I reminded them that this really is nothing new for them.

So to answer the question, LINQ to SQL is not evil.


  1. Jiangning Tang Says:

    I have to disagree with you on Linq to SQL. It's evil and a waste of resources. Data access technologies should not come from C# language team; it's the realm of SQL Server and data access platform.

    A better alternative is for SQL Team comes up a better IDE for T-SQL. Thinking about it, we have all the stored procedure compilation when SQL engine parse our SQL statements, why not make it available to SQL IDE so we can have all the good stuff of syntax check (better syntax check), error detection, intelligence, etc... When that happens, one merit of Linq to SQL is gone.

    I am mostly a web and SQL developer so I don't see many of the claimed advantages Linq to SQL brings to the table. It is rumored that Linq to SQL will die and Entity Framework will prevail. I can't wait to see MS kills Linq to SQL or reduce it to Linq to Objects.

    I can see how Linq to Objects, Linq to XML etc unify all kinds of technologies, but leave SQL to sql server.