[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Permissions on objects accessed inside a trigger.

Posted on 2004-09-21
5
Medium Priority
?
184 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 750 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

656 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