title: Is a stored procedure with EXECUTE AS OWNER a valid replacement for a view selecting from third-schema tables?
body: <p>A database user <strong>A</strong> should only have access to specific data.
  This data is currently provided by a view <strong>B.VIEW1</strong> selecting from tables owned by schema <strong>B</strong> and <strong>C</strong>.</p>
  
  <pre><code>CREATE VIEW [B].[VIEW1] AS SELECT * FROM [B].[VIEW2], [C].[VIEW1]
  </code></pre>
  
  <p>Since <strong>C.VIEW1</strong> is not owned by <strong>B</strong>, <a href="http://msdn.microsoft.com/en-us/library/ms188676.aspx">Ownership Chains</a> apply.</p>
  
  <p>That means although <strong>A</strong> is granted <em>SELECT</em> permission ON <strong>B.VIEW1</strong>, it can't select from.</p>
  
  <pre><code>SELECT permission denied on object 'C.VIEW1', database '...', schema '...'.
  </code></pre>
  
  <p>Is a stored procedure <strong>B.PROC1</strong> with <a href="http://technet.microsoft.com/en-us/library/ms188354.aspx"><em>EXECUTE AS OWNER Clause</em></a> a valid replacement for <strong>B.VIEW1</strong> in terms of security?</p>
  
  <pre><code>CREATE PROC [B.PROC1] WITH EXECUTE AS OWNER AS BEGIN SELECT * FROM [B.VIEW2], [C].[VIEW1] END
  </code></pre>
  
  <p>Or are there any negative side-effects which will possibly lead to any security problems?</p>