<p>I'm still trying to get my head around LINQ and accessing a SQL Database.</p>

<p>I was always taught that you should only have execute permissions of stored procedures to your data.</p>

<p>You should never have select / insert / update / delete.</p>

<p>(This is because of performance and security)</p>

<p>To get the data out of LINQ you obviously need select permissions.  I know you can use stored procs with LINQ, but since I can't do joins what's the point?</p>

<p>Have I missed something???</p>

[{'answer_id': 49609, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': True, 'text': "<p>1) We're programmers, not DBA fascists.  If your requirements state that the database must be locked down 100%, Linq is not for you.  I'm not a DBA, so I believe that most of the performance/security hype is just that.  Linq is for me.</p>\n\n<p>2) You can do joins with linq.</p>\n\n<p><em>@Philippe</em>:  Linq automatically transforms evaluations into query parameters, so it provides some sql injection protection.  However, you still have to closely evaluate your requirements to determine how much security you need and at what levels.  Linq makes dealing with the database much easier, but it makes it easier to put secuirty design on the back burner, which is a bad thing.  </p>\n"}, {'answer_id': 49658, 'author': 'Chris Zwiryk', 'author_id': 734, 'author_profile': 'https://Stackoverflow.com/users/734', 'pm_score': 0, 'selected': False, 'text': '<p>I\'m very much in agreement with Jeff Atwood on the "Stored Procedures vs. Inline SQL/LINQ" issue:  <a href="https://blog.codinghorror.com/who-needs-stored-procedures-anyways/" rel="nofollow noreferrer">Who Needs Stored Procedures, Anyways?</a>.</p>\n\n<p>I\'m confused as to why you\'d even want to perform a JOIN if you\'re in the SPROCs-for-everything crowd; shouldn\'t you wrap that JOIN up into another SPROC?</p>\n\n<p>As Will said, LINQ wasn\'t designed for the kind of DB use you\'re talking about; it was designed to give us statically-typed inline SQL. You could, however, still control access through user permissions if you use LINQ to SQL.</p>\n'}, {'answer_id': 49778, 'author': 'Philippe', 'author_id': 920, 'author_profile': 'https://Stackoverflow.com/users/920', 'pm_score': 0, 'selected': False, 'text': "<p>Well, for security reasons you should not input any user entered data into queries. If you stick with this rule, I don't see the problem of having select permission.</p>\n"}, {'answer_id': 49801, 'author': 'Peter', 'author_id': 5189, 'author_profile': 'https://Stackoverflow.com/users/5189', 'pm_score': 0, 'selected': False, 'text': '<p>Whether all of your database access is "behind" stored procedures depends on the needs of the application and the company.  I have implemented systems that use views to get all data and stored procedures for all updates. This allows for centralized security and database logic while still letting front-end developers use SQL queries where appropriate.</p>\n\n<p>Like so many other things in programming - it depends on the needs for your project.</p>\n\n<p>LinqToSql does support stored procedures.  Scott Gu has a post on it:</p>\n\n<p><a href="http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx</a></p>\n'}]
['https://Stackoverflow.com/questions/49551', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5188/']