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
Solved

Permissions on objects accessed inside a trigger.

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
backup job space check 4 39
How to export SQL to firebase ? 7 65
where to find DTS instalation package for sql 2014 64 bit 3 10
SQL R 21 22
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…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

792 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