title: What security benefits are provided by using stored procedures to access data?
body: <p>I have seen some guidance which recommends that you secure a database by layering all data access through stored procedures.</p>
  
  <p>I know that for SQL Server, you can secure tables, and even columns against CRUD operations.  </p>
  
  <p>For example: </p>
  
  <pre><code> --// Logged in as 'sa'
   USE AdventureWorks;
   GRANT SELECT ON Person.Address(AddressID, AddressLine1) to Matt;
   GRANT UPDATE ON Person.Address(AddressLine1) to Matt;
  
   --// Logged in as 'Matt'
   SELECT * from Person.Address;                       --// Fail
   SELECT AddressID, AddressLine1 from Person.Address; --// Succeed
   UPDATE Person.Address SET AddressLine1 = '#____ 2700 Production Way' 
          WHERE AddressID = 497;                       --// Succeed
  </code></pre>
  
  <p>Given that you can secure tables and even columns against CRUD operations, how does using a stored procedure provide additional security, or management of security?</p>