Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Error granting execute rights

Author  Topic 

davidahlers
Starting Member

1 Post

Posted - 2012-06-07 : 21:28:38
What rights does an account need to:
Create and grant execute permissions on stored procedures
Create tables
Create views

We have an application that dynamically creates stored procedures (using SMO) and grants execute permissions on those stored procedures to NT Authority\Authenticated Users. Our code executes fine on test and dev environments. When we move to production, we get:

Granting rights on GetRequestData returned error: System.Data.SqlClient.SqlException (0x80131904): Cannot find the object 'GetRequestData_6', because it does not exist or you do not have permission. Cannot find the object 'GetRequestData_6', because it does not exist or you do not have permission. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

Application runs under domain system account. This account was granted permissions this way, which works everywhere but production:
grant create table to [domain \zzz] with grant option
grant create view to [domain \zzz] with grant option
grant create procedure to [domain \zzz] with grant option

We then tried to add account as ddladmin. Still fails with same error.

We then tried
grant create on schema::dbo to [zzz]
grant create table on schema::dbo to [zzz]
grant alter on schema::dbo to [zzz]

Then we made account DBO, which resolved the issue. But for security reasons we cannot do this. This server is managed by our IT dept – we suspect some kind of lockdown but cannot figure out how to resolve.


Dave

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2012-06-08 : 11:32:44
1. is the domain system account application runs under [domain \zzz] ?
2. Granting rights on GetRequestData but error on GetRequestData_6 is accurate. Two different sprocs? It does sound like GetRequestData_6 was never created
3. Why are you opting for creating sprocs and tables dynamically? What is the reason for doing this sort of thing?
<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -