Solved

Permissions on objects accessed inside a trigger.

Posted on 2004-09-21
5
181 Views
Last Modified: 2010-08-05
I have a trigger in table A, the trigger updates tables C and D and it also have do a call to an the stored procedure which updates and do insertions on tables X and Y.

- Do I need to specify additional permisions for update/insert on Table C and D for those users who have access to table A ?
- Do I need to specify additional permisions for update/insert on Table X and Y for those users who have access to table A, because those tables are updated through a stored procedure ?

Thanks in advance,
0
Comment
Question by:fischermx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 15

Expert Comment

by:jdlambert1
ID: 12116916
You don't need to specify additional permissions.
0
 
LVL 1

Author Comment

by:fischermx
ID: 12117019

So, I don't need permissions for any, any, any thing ussed inside a trigger ?
Well, that's what I knew, too, but  why am I getting a INSERT permission denied on object 'MyTableAccessedInsideAStoredInsideATrigger', database 'MyDB', owner 'dbo'  ??

Which special situations would requiere a specific permissions ?

0
 
LVL 14

Expert Comment

by:Jan_Franek
ID: 12117109
AFAIK it depends on who is the owner of all these objects - if all the tables A, C, D, X and Y as well as the stored procedure have the same owner, there shouldn't be any problem with permissions. However, if some of these objects has different owner, you may need to specify some permissions.
0
 
LVL 1

Author Comment

by:fischermx
ID: 12117197

I found the problem.
The table with the permissions problem was being accessed through dinamyc SQL using Execute(@MyStmt).

Reading the same table outside of it, just some lines before that call, didn't cause any problem, though.

Regards,
0
 
LVL 15

Accepted Solution

by:
jdlambert1 earned 250 total points
ID: 12117221
Okay, I was completely wrong. I haven't had that problem because all my objects are owned by dbo.

Either the tables all have to have the same owner, or the tables down-stream from the first table (the one with the trigger on it) have to have appropriate permissions (insert/update/delete, depending on the trigger's or sp's actions) for the owner of the first table. Otherwise, it's a "broken ownership chain".
0

Featured Post

Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question