Impersonation in SQL Server Views? -


is possible create views impersonation, similar "execute as" in stored procedures?

i create views in separate schema. users should select , update access these views, able change underlying tables, without having direct update access table.

is possible view ?

no, not possible. execute used sp's, can use them bit more widely. from technet:

in sql server can define execution context of following user-defined modules: functions (except inline table-valued functions), procedures, queues, , triggers.

...

functions (except inline table-valued functions), stored procedures, , dml triggers { exec | execute } { caller | self | owner | 'user_name' }

ddl triggers database scope { exec | execute } { caller | self | 'user_name' }

ddl triggers server scope , logon triggers { exec | execute } { caller | self | 'login_name' }

queues { exec | execute } { self | owner | 'user_name' }

however, have options here:

  • create get-sp's return data , update-sp's upate data (i use xml input instead of table-variables)
  • use views created 'impersonated' user, , play permission inheritance breaking using deny/grant, grant view definition

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -