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
 General SQL Server Forums
 New to SQL Server Administration
 Exec Grant on Login's SP: cant touch table

Author  Topic 

phrankbooth
Posting Yak Master

162 Posts

Posted - 2013-01-29 : 15:49:06
Hi,

--SQL Server 2008 R2--
I have created a Login in a DB, that login has db_datareader and db_datwriter and it has Execute on all the SP's in the DB.

When I execute that SP, I get a rights error on the table referenced by the SP. But when I add the table as a securable for that user with the appropriate Grants, then it works.

I was under the impression that is you set Exec rights on the SP's then you don't have to set any rights on the tables that SP touches, is this not correct? And therefore i will have to set grants for ALL the tables too?

Thanks!


--PhB

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2013-01-29 : 15:55:19
Is it using dynamic SQL?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

phrankbooth
Posting Yak Master

162 Posts

Posted - 2013-01-29 : 15:56:55
No it isn't.

Thanks for the reply.

--PhB
Go to Top of Page

phrankbooth
Posting Yak Master

162 Posts

Posted - 2013-01-29 : 16:30:43
The SP performs a truncate on the table. I've read that you need to assign extra rights beyond exec on the SP is truncate is being called on a table.

--PhB
Go to Top of Page

phrankbooth
Posting Yak Master

162 Posts

Posted - 2013-01-29 : 16:58:46
Yes, in fact you need a minimum of ALTER on the table being truncated otherwise you'll get an error. See Remarks here:
http://msdn.microsoft.com/en-us/library/ms177570.aspx

--PhB
Go to Top of Page
   

- Advertisement -