asp.net - SQL Server Permissions -


this typical sql server error, know:

the execute permission denied on object 'getstaffdirectorylistingsbycompany', database 'mydb', schema 'dbo'.  

i able fix in ssms adding execute permission 'iis apppool\defaultapppool'. tried add specific apppool application 'iis apppool\myapppool' not locate in ssms. why happening?

my question simple: db dozens of stored procedures, how add permission once instead of having manually each stored procedure?

i couldn't following work:

https://msdn.microsoft.com/en-us/library/ms187940.aspx

update

i should point out background problem:

first, win7 dev machine upgraded windows 10 , somehow projects associated defaultapppool in iis (as own app pools).

second, db restored version on production server local dev machine (maybe why permissions messed up?).

you can either grant execute permission on schema or on whole db, example:

use [mydatabase] go  -- grant execute permission on schema dbo grant execute on schema::[dbo] [myuser] go 

or

use [mydatabase] go  -- grant execute permission on db grant execute [myuser] go 

i hope helps.


following comment irishchieftain:

upon reading particular scenario more carefully, see seems ssms not showing iis apppool\myapppool on mydb database.

most root cause different group granting application access db. not iis expert, , not sure why granting access default pool worked (the sids should not have matched, app running under default application pool?).

in case, recommend trying following: replace myuser more specific pool iis apppool\myapppool; command should create user implicitly, , should start showing in ssms.

please let know if worked, can try different approach.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -