Solved

Permissions on objects accessed inside a trigger.

Posted on 2004-09-21
5
177 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

758 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now